View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Using the data in the last cell

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