ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Saving a range for later reference (https://www.excelbanter.com/excel-discussion-misc-queries/449953-saving-range-later-reference.html)

Pistolade

Saving a range for later reference
 
I need a macro that will save a range as "VariablesFor" & Job, where Job = Range("F1").Value, as well as save Job xlDown column A. The ranges need to be on the same page, but need to not replace any pre existing data. What I have so far is:
Sub SavingSet()
'
' SavingSet Macro
'
NewJob = Range("G1").Value
'
Range("A2:O33").Select
Selection.Copy
Sheets("VariablesQS").Select
ActiveWindow.SmallScroll Down:=12
Range("B1").End(xlDown).Offset(-1).Select
ActiveSheet.Paste
Selection.Names.Add Name:="VariablesFor" & NewJob
Sheets("Variables").Select
Range("G1").Select
Selection.Copy
Sheets("VariablesQS").Select
Range("A1").End(xlDown).Select
ActiveSheet.Paste
End Sub

However, The First .end(xlDown) doesn't bring it down nearly far enough, or it will just bring it down to row one million something. Then it stops at the selection.Names.Add line, I don't know how to Tell it to select the cells it pasted any other way, since the fresh paste will still be a selection, I would like to do it by referring to that selection.

Any help would be great.
Thanks,
Pistolade


All times are GMT +1. The time now is 04:53 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com