View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Referencing range in another worksheet

dim AllCells as range
with worksheets("Data")
set allcells = .range("a2",.cells(.rows.count,"A").end(xlup))
end with

msgbox allcells.address



gtslabs wrote:

I am trying to reference all the values in in column A in a different
worksheet.
I get errors using this. Please advise on the correct syntax.

Set AllCells = Worksheets("Data").Range("a2", Cells(Rows.Count,
"a").End(xlUp))


--

Dave Peterson