LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default First effort

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
duplicate effort hi Excel Discussion (Misc queries) 1 June 5th 07 08:52 PM
A little more effort... darno[_7_] Excel Programming 4 February 20th 04 07:51 PM


All times are GMT +1. The time now is 02:09 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"