Macro Merge

Ody

Board Regular
Joined
Oct 14, 2010
Messages
215
Hello again,

I'm having trouble merging the following macros:

'go to the first blank row in table of summary sheet
Sheets("Summary").Select
lMaxRows = Cells(Rows.Count, "A").End(xlUp).Row
Range("A" & lMaxRows + 1).Select
with
'reference info from last worksheet to summary sheet
Dim LastSheet As String
LastSheet = Worksheets(Worksheets.Count).Name
Worksheets("Summary").Range("A11").Formula = "='" & LastSheet & "'!J1"
I realized this morning that the range for the second macro is hard coded to A11 of my summary sheet and my attempts to make that range the next blank row in my table instead of A11 is falling flat. Any and all help is appreciated. Thanks.
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Maybe:
Code:
'reference info from last worksheet to summary sheet
Dim LastSheet As String
LastSheet = Worksheets(Worksheets.Count).Name
With Worksheets("Summary")
  lMaxRows = .Cells(.Rows.Count, "A").End(xlUp).Row
  .Range("A" & lMaxRows + 1).Formula = "='" & LastSheet & "'!J1" 
End With
 
Upvote 0
Thanks John!

It's frustrating knowing what you want to do and not being able to do it. THe macro recording only takes me so far.

Thanks again!
 
Upvote 0

Forum statistics

Threads
1,224,590
Messages
6,179,750
Members
452,940
Latest member
rootytrip

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top