Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am trying to define a variable with the data in the last cell in a column.
I've been trying to use the following: Range("A1").Select Dim DataCheck2 As Date DataCheck = Range("A" & (Cells(Rows.Count, ActiveCell.Column).End(xlUp).Offset(-1, 0).Value)).Value |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am trying to define a variable with the data in the last cell in a column.
I've been trying to use the following: Range("A1").Select Dim DataCheck2 As Date DataCheck = Range("A" & (Cells(Rows.Count, ActiveCell.Column).End(xlUp)Value)).Value |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dim DataCheck2 as Date
with activesheet datacheck2 = .cells(.rows.count,"A").end(xlup).value end with Watch your variables (datacheck vs. datacheck2) Amir wrote: I am trying to define a variable with the data in the last cell in a column. I've been trying to use the following: Range("A1").Select Dim DataCheck2 As Date DataCheck = Range("A" & (Cells(Rows.Count, ActiveCell.Column).End(xlUp)Value)).Value -- Dave Peterson |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
this is one way
Sub test() Range("A1").Select Dim DataCheck2 As Date Dim lastrow As Long lastrow = Cells(Rows.Count, "A").End(xlUp).Row DataCheck2 = Range("A" & lastrow).Value Debug.Print DataCheck2 End Sub Gary -- Gary "Amir" wrote in message ... I am trying to define a variable with the data in the last cell in a column. I've been trying to use the following: Range("A1").Select Dim DataCheck2 As Date DataCheck = Range("A" & (Cells(Rows.Count, ActiveCell.Column).End(xlUp)Value)).Value |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how do i find specific data in a cell and its colocated cell data | Excel Worksheet Functions | |||
converting numerical data in one cell to word data in another cell | Excel Worksheet Functions | |||
how to find number in a cell , a cell contains character data ornumeric data | Excel Worksheet Functions | |||
Find MAX data in sheet (Cell) - Any cell that exceeds X amount of data | Excel Discussion (Misc queries) | |||
data validation to restrict input in cell based on value of cell above that cell | Excel Programming |