Copy latest date from one workbook to another

G

Guest

Make your For loop start at 2 instead of 1.


Meltad said:
Silly me!
Got it now...

?i
1
?lngColumnDate
2
?Cells(i, lngColumnDate ).Address
$B$1

So is this failing cos row 1 is the header and not a date? How do I set it
to look at row 2 and below?
 
G

Guest

This looks promising, the first part works fine now, its just the error on
this last line.
Cells(Rows.Count, lngColumnDate).End(xlUp).Offset(1, -2).Select
Once we crack this I'll be able to use this code for so much stuff, THANKS :)
 
G

Guest

Look at the following variables for errors:

?Rows.Count
?Cells(Rows.Count, lngColumnDate).address
?Cells(Rows.Count, lngColumnDate).End(xlUp).Offset(1, -2).address
 
G

Guest

Hi Bill, I got...

?Rows.Count
65536
?Cells(Rows.Count, lngColumnDate).Address
$B$65536
?Cells(Rows.Count, lngColumnDate).End(xlUp).Offset(1, -2).Address
ERROR

The xlUp value is -4162

So... the LF macro workbook is blank and I just need to paste the copied
rows into row 2 so I replaced the lngColumnDate in this line with a 3 and
this worked, all rows were pasted into the 2nd row of the blank workbook.
Does it matter that I've changed this?
Cells(Rows.Count, 3).End(xlUp).Offset(1, -2).Select

Thanks for helping me get to this point!
Mel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top