Getting the above error when I try to run the code in the attached worksheet.
Set My Data is highlighted; any suggestions?
'Open target worksheet
Set myData = Workbooks.Open("C:\Users\The GaffeR\Desktop\Target.xlsx")
Book3.xlsm
Getting the above error when I try to run the code in the attached worksheet.
Set My Data is highlighted; any suggestions?
'Open target worksheet
Set myData = Workbooks.Open("C:\Users\The GaffeR\Desktop\Target.xlsx")
Book3.xlsm
?True friends stab you in the front.?
Try![]()
Please Login or Register to view this content.
John
If you have issues with Code I've provided, I appreciate your feedback.
In the event Code provided resolves your issue, please mark your Thread as SOLVED.
If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.
Done that jaslake; now throws the same error code for RowCount...do I need to declare RowCount as a variable?
'Find last empty row
RowCount = Worksheets("sheet1").Range("A1").CurrentRegion.Rows.Count
Done that jaslake; now throws the same error code for RowCount...do I need to declare RowCount as a variable also?
'Find last empty row
RowCount = Worksheets("sheet1").Range("A1").CurrentRegion.Rows.Count
Last edited by Limitedtimeonearth; 06-02-2013 at 01:53 PM. Reason: duplicate post
Yeap. It's recommended to declare variables. VBA allows not to declare variables by turning off Option Explicit statement but it is not recommended.
MSDN quote concerning Option Explicit and declaring variables:
Use Option Explicit to avoid incorrectly typing the name of an existing variable or to avoid confusion in code where the scope of the variable is not clear. If you do not use the Option Explicit statement, all undeclared variables are of Object type.
Hi Limited
Yes...![]()
Please Login or Register to view this content.
Hi, Limitedtimeonearth,
I always wonder where people find codes like the one you used - why not just use
Ciao,![]()
Please Login or Register to view this content.
Holger
Use Code-Tags for showing your code: [code] Your Code here [/code]
Please mark your question Solved if there has been offered a solution that works fine for you
jaslake,
Thanks for your time fella; appreciated.
HaHoBe,
Haven't got time to play with your code tonight but appreciate the time and effort you've put in to producing it for me. I'll try your code over the next few days; looks a lot tidier than what I'm using (he said pretending he knows what he's on about) but there is some mileage in me persevering with the original code if only to gain some learning re vba coding.
Cheers guys
You're welcome...glad I could help. Thanks for the Rep.
Hi, Limitedtimeonearth,
I tend to use as few varaibles as needed (sometimes I alter the way to solve a problem and then have some being dimmed but not used). But letīs get more practical. Right now the code copies the second row of the worksheet you start in. Just imagine to change the code you use right now to reflect the last row used.
BTW: as this is solved please mark the thread as this. Thanks.
Ciao,
Holger
Tried replacing: lngFF = .Range("A" & Rows.Count).End(xlUp).Row + 1
with:
Last Row = .Range("A" & Rows.Count).End(xlUp).Row + 1
but didn't work....hmmmm
Maybe I need to declare Last Row as a variable?
Nope; that won't work either![]()
Opps; forgot to "lose" the space between Last and Row....
Will start new thread...
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks