Macro (Button) Paste Named Range in next available row
Hello, I have a tool which tracks the stats of meetings. Each type of meeting has it's own named range. When a new meeting is held, that meeting's range is pasted at the next available row.
I would like a button to allow a user to "Insert a new meeting" they would be able to select which named range they need, and the macro would paste this named range at the next available row.
I have attached an example for further clarity.
Attachment | Size |
---|---|
Paste Named Range in next available row.xlsm | 21.04 KB |
Try This...
Sub next_named_range()
Dim named_range
named_range = InputBox("Which Named Range would you like to use?", "Named range Select", 2)
Application.Goto Reference:=named_range
Selection.Copy
myrow = Worksheets("Sheet1").Cells(Rows.Count, 7).End(xlUp).Row
Dim tgt_cell
tgt_cell = "D" & myrow + 1
Range(tgt_cell).Select
ActiveSheet.Paste
Range(tgt_cell).Select
End Sub