I'm trying to modify Ron de Bruin's CopyRangeFromMultiWorksheets() macro to copy individual columns from multiple worksheets, so I modified the code with
as a test. That worked great, except each worksheet has a different number of rows.
So what I need is something like this because the last used cell in each worksheet is different, but of course the code below is causing an error on compile. The columns in each worksheet are the same, just different number of rows in each worksheet, so I'm trying to use something like this to determine the last used cell in each worksheet. Theoretically the row count of Column B is the same as L, K, M in each worksheet, so if there is a better way to do this than row counting each column that would be great.
psuedocode:
Thanks,
Don
Code:
Set CopyRng = sh.Range("B1:B11, L1:L11, K1:K11, M1:M11")
So what I need is something like this because the last used cell in each worksheet is different, but of course the code below is causing an error on compile. The columns in each worksheet are the same, just different number of rows in each worksheet, so I'm trying to use something like this to determine the last used cell in each worksheet. Theoretically the row count of Column B is the same as L, K, M in each worksheet, so if there is a better way to do this than row counting each column that would be great.
psuedocode:
Code:
Set CopyRng = sh.Range("B1:B" & Range("B" & Rows.Count).End(xlUp).Row),& _
"L1:L" & Range("L" & Rows.Count).End(xlUp).Row),& _
"K1:K" & Range("K" & Rows.Count).End(xlUp).Row),& _
"M1:M" & Range("M" & Rows.Count).End(xlUp).Row)
Thanks,
Don