Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How do I paste data to an variable row?

Any help on this would be greatly appreciated. What I'm trying to do is copy
data from a set range of cells, and paste that data to a variable row & set
column.
Thank You

Dave


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,092
Default How do I paste data to an variable row?

Dim VarRow as Integer
VarRow = Some formula to find a row
Range("B6:C" & VarRow).Paste

"DAVE McClean" wrote in message
hlink.net...
Any help on this would be greatly appreciated. What I'm trying to do is

copy
data from a set range of cells, and paste that data to a variable row &

set
column.
Thank You

Dave




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default How do I paste data to an variable row?

Dim rng as Range
set rng = worksheets("sheet1").Range("B1:C20")
rng.copy Destination:=Worsheets("sheets2"). _
Cells(rows.count,1).End(xlup)(2)

--
Regards,
Tom Ogilvy

DAVE McClean wrote in message
hlink.net...
Any help on this would be greatly appreciated. What I'm trying to do is

copy
data from a set range of cells, and paste that data to a variable row &

set
column.
Thank You

Dave




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 103
Default How do I paste data to an variable row?

you don't say how you select the source that you want to copy.
So...

Dim Source as Range
Dim Target as Range
SET Source = Worksheets("Sheet1").Range("G5:M27")
'or as another example...using a user-selected range
'SET Source = Selection

Set Target = Worksheets("Sheet3").Range("C3")
' or if the sourec was defined
SET Target = Selection

'now copy the data
With Target.Resize(Source.Rows.Count, Source.Columns.Count)
.Value = Source.Value
End With


--
Patrick Molloy
Microsoft Excel MVP
----------------------------------
"DAVE McClean" wrote in message
hlink.net...
Any help on this would be greatly appreciated. What I'm trying to do is

copy
data from a set range of cells, and paste that data to a variable row &

set
column.
Thank You

Dave




Reply
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
How to copy&paste a variable range rows and colums IK Excel Discussion (Misc queries) 1 August 30th 06 12:06 AM
Excel cut/Paste Problem: Year changes after data is copy and paste Asif Excel Discussion (Misc queries) 2 December 9th 05 05:16 PM
how do i use the function to copy and paste a determined variable. Strem Excel Worksheet Functions 2 January 8th 05 05:31 PM
Paste a Range from a variable Al[_11_] Excel Programming 3 October 28th 03 06:04 PM
How to paste variable value onto a Cell? Milind Excel Programming 1 July 29th 03 09:55 PM


All times are GMT +1. The time now is 11:44 AM.

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

About Us

"It's about Microsoft Excel"