Making a macro with random placement.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I get a report each week. where the data will not be in order and you can not filter by name
Example
Jellybeans Early>10Days Early6-10Days Early1-5Days Early/Late0Days Late1-5Days Late6-10Days Late>10Days EarlyTotal
Data Data Data Data Data Data Data Data Dat
Data Data Data Data Data Data Data Data Dat
Data Data Data Data Data Data Data Data Dat
Data Data Data Data Data Data Data Data Dat
Soap Early>10Days Early6-10Days Early1-5Days Early/Late0Days Late1-5Days Late6-10Days Late>10Days EarlyTotal
Data Data Data Data Data Data Data Data Dat
Data Data Data Data Data Data Data Data Dat
Data Data Data Data Data Data Data Data Dat
Data Data Data Data Data Data Data Data Dat

So, Sometimes Jelly beans and the 5 rows of data are A16-I20. Next time the report is run Jellybeans is A34-I38. Is thier a way to macro what I need without selectin a certain row. Where Jellybean is the taget and it will copy 9 colums to the right and 4 rows below it
Thanks, DJ
 
Range("A:A").Find("Jellybeans").Offset(1,0).Resize(4,9).copy _
Destination:=Worksheets("Sheet2").Range("A1")

--
Regards,
Tom Ogilvy


Duncan J said:
I get a report each week. where the data will not be in order and you can not filter by name.
Example.
Jellybeans Early>10Days Early6-10Days Early1-5Days Early/Late0Days
Late1-5Days Late6-10Days Late>10Days EarlyTotals
Data Data Data Data
Data Data Data Data Data
Data Data Data Data
Data Data Data Data Data
Data Data Data Data
Data Data Data Data Data
Data Data Data Data
Data Data Data Data Data
Soap Early>10Days Early6-10Days Early1-5Days Early/Late0Days Late1-5Days
Late6-10Days Late>10Days EarlyTotals
Data Data Data Data
Data Data Data Data Data
Data Data Data Data
Data Data Data Data Data
Data Data Data Data
Data Data Data Data Data
Data Data Data Data
Data Data Data Data Data
So, Sometimes Jelly beans and the 5 rows of data are A16-I20. Next time
the report is run Jellybeans is A34-I38. Is thier a way to macro what I need
without selectin a certain row. Where Jellybean is the taget and it will
copy 9 colums to the right and 4 rows below it?
 
Thanks Tom
You put me on the right track... This what worked
Range("A:A").Find("Jellybeans").Offset(0, 0).Resize(5, 14).Copy
Destination:=Worksheets("Sheet2").Range("A1")
 
Specification said:
it will copy 9 colums to the right and 4 rows below it

Didn't say to copy the row with Jellybeans. Unfortunately mindreading is
not a strength. <g>

so you don't need Offset(0,0). That does nothing.
 
Back
Top