Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 266
Default Copy Cells - using Variable

I want to copy cells from one row to another using the row number and column
number of both source and destination. Example: copy FROM row 10 column 20
through row 10 column 30 TO row 100 column 50.

This is a clarification to my previous post. I want to use a variable to do
this. So 10, 20, 30, 50 and 100 will be variables. Can anyone provide the
syntax for that? Thanks for any help on this.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,124
Default Copy Cells - using Variable

Like this?

Sub copyvariablerows()
fr = 10
fc = 20
fco = 30
dr = 100
dc = 50
Range(Cells(fr, fc), Cells(fr, fco)).Copy Cells(dr, dc)
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"dhstein" wrote in message
...
I want to copy cells from one row to another using the row number and
column
number of both source and destination. Example: copy FROM row 10 column 20
through row 10 column 30 TO row 100 column 50.

This is a clarification to my previous post. I want to use a variable to
do
this. So 10, 20, 30, 50 and 100 will be variables. Can anyone provide the
syntax for that? Thanks for any help on this.


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,942
Default Copy Cells - using Variable

hi
another way??
Sub ctest()
Dim r As Range
Dim ro As Range
Set r = Range(Cells(10, 20), Cells(10, 30))
Set ro = Cells(100, 50)
r.Copy ro
End Sub

regards
FSt1

"dhstein" wrote:

I want to copy cells from one row to another using the row number and column
number of both source and destination. Example: copy FROM row 10 column 20
through row 10 column 30 TO row 100 column 50.

This is a clarification to my previous post. I want to use a variable to do
this. So 10, 20, 30, 50 and 100 will be variables. Can anyone provide the
syntax for that? Thanks for any help on this.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 266
Default Copy Cells - using Variable

Thanks for the answers

"dhstein" wrote:

I want to copy cells from one row to another using the row number and column
number of both source and destination. Example: copy FROM row 10 column 20
through row 10 column 30 TO row 100 column 50.

This is a clarification to my previous post. I want to use a variable to do
this. So 10, 20, 30, 50 and 100 will be variables. Can anyone provide the
syntax for that? Thanks for any help on this.

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
Copy cells to variable number of rows Acct Supr - DCTC Excel Discussion (Misc queries) 5 September 26th 09 12:58 PM
Copy By Variable zyus Excel Discussion (Misc queries) 4 June 16th 09 03:27 AM
VBA help to copy variable range Eduardo Excel Discussion (Misc queries) 7 August 18th 08 09:16 PM
copy formulas to cells absolute rows and variable columns Mark Excel Discussion (Misc queries) 1 January 30th 06 10:15 PM
Sum cells based on a row variable and seperate column variable CheeseHeadTransplant Excel Worksheet Functions 10 September 23rd 05 06:59 PM


All times are GMT +1. The time now is 06:57 PM.

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"