Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I want to to prompt the user for a range to copy, copy that range to a new
column, then change the original range to values. It gets hung up on the line Range("OldRange1:OldRange2").Select. I tried prompting for the whole OldRange(R1:T100) but couldn't get that to work so I tried what you see below and got further down. I suppose I have an incorrect syntax, so would the same answer apply to the Range("Old/NewRange").select statements that follow it? This is a modified Recorded macro so it's probably clumsy but you've got to start somewhere. Your help is appreciated. Sub MonthlyAvailReport2() ' ' MonthlyAvailReport2 Macro ' Prepare monthly report new columns, values. Dim OldRange1 As Range Dim OldRange2 As Range Dim NewRange As Range Set OldRange1 = Application.InputBox _ (prompt:="Enter the first column of last month's figures in format R1", Type:=8) Set OldRange2 = Application.InputBox _ (prompt:="Enter the last column of last month's figures in format T100", Type:=8) Set NewRange = Application.InputBox _ (prompt:="Enter next column in format U1", Type:=8) Range("OldRange1:OldRange2").Select Selection.Copy Range("NewRange").Select ActiveSheet.Paste Range("OldRange").Select Application.CutCopyMode = False Selection.Copy Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _ False, Transpose:=False Application.CutCopyMode = False End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
duplicate effort | Excel Discussion (Misc queries) | |||
A little more effort... | Excel Programming |