Discussion Locked

crate xl range name from a variable

0 helpful
0 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

My macro copies a template worksheet, renames it with user prompted (msgbox) value with leading zeroes. The value "newname" becomes the sheet name as well as the contents of cell D3, E3 will contain a balance. I want to list the various D3's and E3's on Consolidated sheet so I can see the current balance for each sheet. I can't get "newname" to copy on to Consolidated.

Dim Newname As String
Newname = InputBox("Enter Letter of Credit Number including Leading Zeroes")
Sheets("Blank").Select
Sheets("Blank").Copy Before:=Sheets(2)
Sheets("Blank (2)").Select
Sheets("Blank (2)").Name = Newname
Range("D3").Select
ActiveCell.FormulaR1C1 = Newname
Range("C10").Select
Application.Goto Reference:="LCListhome"
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveCell.FormulaR1C1 = Newname

0 replies

No replies were posted before this discussion closed.

This discussion is closed to new replies.