Counting entries from the right

  • Thread starter Graham Whitehead
  • Start date
G

Graham Whitehead

For a while now I have been using some code to determine how far down a
worksheet the last line of data appears. For example:

With ActiveSheet
lngLastRow = .Range("A65536").End(xlUp).Row
End With

Does anyone know the equivalent function to count how far out from the left
(i.e. if there is data in columns A to G) - I'm sure it must exist but
cannot quite figure it out.

thanks
 
B

Bob Phillips

lngLastCol = .range(1,Columns.Count).End(xlToLeft).Column

based upon row 1

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 
G

Graham Whitehead

Thanks Bob.

Bob Phillips said:
lngLastCol = .range(1,Columns.Count).End(xlToLeft).Column

based upon row 1

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 
Top