MeldrethMan
Technical User
I'm successfully sending data to Excel, code extract below
Set rst = CurrentDb.OpenRecordset("SELECT * FROM tblSelectedClients")
rst.MoveFirst
Do While Not rst.EOF
objSht.Cells(iRow, 1).Value = rst!Name
objSht.Cells(iRow, 2).Value = rst!Company
objSht.Cells(iRow, 3).Value = rst!Address1
objSht.Cells(iRow, 4).Value = rst!Address2
objSht.Cells(iRow, 5).Value = rst!Address3
objSht.Cells(iRow, 6).Value = rst!Town
objSht.Cells(iRow, 7).Value = rst!County
objSht.Cells(iRow, 8).Value = rst!Postcode
objSht.Cells(iRow, 9).Value = rst!FirstName
objSht.Cells(iRow, 10).Value = rst!LastName
objSht.Cells(iRow, 11).Value = rst!Status
iRow = iRow + 1
rst.MoveNext
Loop
I'd like to have conditional formatting in the resulting spreadsheet according to the value of Status. This can have several values so would like say
If Status is Invoiced, colour the cell Red
If Paid, then Green
Going a step further, colouring the entire spreadsheet row would be a real bonus.
Any steers would be much appreciated.