LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 772
Default Select a variable range

Change that last Activesheet.Paste to
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"Eduardo" wrote:

John, it works but I forgot to mention that the range J10 to P contains
formula how do I paste as value
Thank you

"John Bundy" wrote:

This should do it for you, you may have to modify a bit to go with the rest
of your code
Dim lastRow As Long
lastRow = Cells(Rows.Count, "P").End(xlUp).Row
'set variable to the last used row in P
Range("J10:P" & lastRow).Copy

Sheets("Sheet2").Select
Sheets("Sheet2").Range("C17").Select
ActiveSheet.Paste
--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"Eduardo" wrote:

I have 5 stores sending their orders in an excel spreadsheet, there it is
where depending on the items ordered the range will vary. So what I need is
to select the range from J10 to the last row used in "P" and copy it into
cell C17 in Sheet2

"John Bundy" wrote:

Shouldn't be a problem, where will you be getting the info on where to end?
Such as, does the user provide the end of the range? Is it just the last
non-empty store in column P? Once you know that it will be no prob.
--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"Eduardo" wrote:

Hi to all, thanks to your help I am almost their on getting an EDI format
file from an excel file. What I need to do is to select a variable range i.e.
J10 to P ?? from sheet1 and copy it into cell c17 in sheet 2
thank you

 
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
Select a variable range Bluecat Excel Worksheet Functions 7 January 13th 09 01:24 AM
Use a Variable to select a range Connie Excel Discussion (Misc queries) 3 October 19th 06 05:48 PM
select a variable range evil baby[_15_] Excel Programming 4 March 8th 06 08:38 PM
select range and put range address in variable [email protected] Excel Programming 2 January 25th 06 01:28 AM
Select a Range Through a Variable GoFigure[_9_] Excel Programming 3 December 6th 05 01:02 PM


All times are GMT +1. The time now is 10:14 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"