Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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)) |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try this:
Set AllCells = Worksheets("Data").Range("a2", Cells(Rows.Count, "a").End(xlUp).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)) |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Dec 11, 9:19*pm, JLGWhiz wrote:
Try this: Set AllCells = Worksheets("Data").Range("a2", Cells(Rows.Count, "a").End(xlUp).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))- Hide quoted text - - Show quoted text - it only got 2 of the 17 cells that currently have data. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If that throws an error then try this:
Set AllCells = Worksheets("Data").Range("a2:" & Cells(Rows.Count, "a").End(xlUp).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)) |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Dec 11, 9:31*pm, JLGWhiz wrote:
If that throws an error then try this: Set AllCells = Worksheets("Data").Range("a2:" & Cells(Rows.Count, "a").End(xlUp).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))- Hide quoted text - - Show quoted text - same 2 cells returned |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Dec 11, 9:46*pm, Dave Peterson wrote:
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 Yes, that worked - Thank you all |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Referencing a named range based upon Range name entry in cell | Excel Worksheet Functions | |||
CountIF() in Worksheet B while referencing cells in Worksheet A | Excel Worksheet Functions | |||
CountIF() in Worksheet B while referencing cells in Worksheet A | Excel Worksheet Functions | |||
Range error when referencing non active worksheet | Excel Programming | |||
range referencing | Excel Programming |