Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
 
Posts: n/a
Default Controlling odd even rows when pasting data

I want to paste data into an excel sheet.
But I want to paste one large amount of data into even rows, then an equally
large amount of it into odd rows.

How do I direct the data to be pasted to only the assigned rows?

est 3000 to five thousand rows of data into each paste.

Thanks in advance



  #2   Report Post  
Jim Cone
 
Posts: n/a
Default

John,

This code does the data transfer for the even rows only...

'---------------------------------------
'Transfer data from each row in rngTwo into
'the even numbered rows in rng one.
'Jim Cone - San Francisco, USA - Feb 23, 2005

Sub OddManOut()
Dim lngR As Long
Dim lngN As Long
Dim rngOne As Excel.Range
Dim rngTwo As Excel.Range

'rngOne must be have twice as many rows as rngTwo
Set rngOne = Range("A1:D40") 'Change to the applicable range
Set rngTwo = Range("E1:H20") 'ditto

For lngR = 1 To rngOne.Rows.Count
If rngOne.Rows(lngR).Row Mod 2 = 0 Then
lngN = lngN + 1
rngOne.Rows(lngR).Value = rngTwo.Rows(lngN).Value
End If
Next 'lngR
End Sub
'---------------------------------------
Regards,
Jim Cone
San Francisco, USA



"

wrote in message ...

I want to paste data into an excel sheet.
But I want to paste one large amount of data into even rows, then an equally
large amount of it into odd rows.
How do I direct the data to be pasted to only the assigned rows?
est 3000 to five thousand rows of data into each paste.
Thanks in advance

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
pasting excel data in a powerpoint slide James Excel Discussion (Misc queries) 4 January 28th 05 02:23 PM
How to use outline data (grouped rows) in a protected worksheet? biometris Excel Discussion (Misc queries) 0 January 17th 05 09:47 AM
Pulling data from 1 sheet to another Dave1155 Excel Worksheet Functions 1 January 12th 05 05:55 PM
Multiple rows of data on a single axis (charting) ramseysgirl Charts and Charting in Excel 8 December 29th 04 06:00 PM
how do i merge 2 rows of data into one willid Excel Discussion (Misc queries) 3 November 30th 04 07:43 PM


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