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: 536
Default Copy row info but not in normal column sequence

A fairly simple macro to lookup the date posted in cell B1 and for each matching date in the named range DataA column, return data in a non sequential
manner.

As below the data returned is column 3, 1, 4 & 8. This works okay but the final version has 11 columns to return in a similar "scatter gun" method.

In this case it would be columns in this order from the DataA column C:

D, G, R, S, W, AF, AG, Y, AD, N & AE.

Making eleven different offset copy lines seems a bit clunky, but it would be the easiest for me, as I don't know how to skip various column and then return back to get them without the individual copy offsets.

Then the next hurdle is to return the data to C10 through M10 and downward from there.

Thanks,
Howard


Option Explicit

Sub DataACopy()

Dim DataA As Range
Dim c As Range
Dim aDate As String

aDate = Range("B1").Value

Application.ScreenUpdating = False
For Each c In Range("DataA")
If c.Value = aDate Then
c.Offset(, 3).Copy
Sheets("Sheet2").Range("C100").End(xlUp).Offset(1, 0).PasteSpecial

c.Offset(, 1).Copy
Sheets("Sheet2").Range("D100").End(xlUp).Offset(1, 0).PasteSpecial

c.Offset(, 4).Copy
Sheets("Sheet2").Range("E100").End(xlUp).Offset(1, 0).PasteSpecial

c.Offset(, 8).Copy
Sheets("Sheet2").Range("F100").End(xlUp).Offset(1, 0).PasteSpecial

End If
Next
Application.ScreenUpdating = True
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
How to copy info into blank cells within a column (going up the co Marty Excel Discussion (Misc queries) 1 January 19th 09 12:18 AM
Copy info into empty cells below info, until finds cell with new d Fat Jack Utah Excel Discussion (Misc queries) 3 November 16th 08 08:34 PM
How to update column info based on column info from another worksh Hummingbird Excel Discussion (Misc queries) 3 July 29th 08 09:54 PM
comparing a column of cell and then copy info Kelly******** Excel Programming 0 March 21st 06 11:08 PM
comparing a column of cell and then copy info to other cells Kelly******** Excel Discussion (Misc queries) 0 March 21st 06 09:51 AM


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