View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
[email protected] paul.robinson@it-tallaght.ie is offline
external usenet poster
 
Posts: 789
Default Deleting several cells at once causes a VBA error

Hi
Cell.Row

will give you the absolute row number

Range.Row

will give you the row number of the first cell in range
eg Range("G12:G511").row is 12

Range("G12:G511").Cells(3,1).Row will give you the absolute row number
of Cells(3,1) in Range
eg Range("G12:G511").Cells(3,1).Row is 14

If you want the row number relative to the first row in the Range use,
for example,
Range("G12:G511").Cells(3,1).Row -Range("G12:G511").Row + 1

which is 14 - 12 + 1 = 3

Highlight Row in the VBE and hit F1 to see the type etc of Row

regards
Paul