Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default looping and copying

Hello,

I need to do a loop, that looks at keywords and then acording to them
copies the data to another sheet.
The table is something like that:

Keyword Text Value Value
key1 dog 1 3
key1 cat 3 4
key2 cow 9 8
key3 fox 44 5

So, the loop should look at the keywords, and then copy the data to
aother range (every keyword has it's own range).

Thanks to everyone who takes the time to reply.

Juuljus

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default looping and copying

Got that. Used Advanced Filter.
If anyone has a better idea, then would be nice so read it.

Juuljus

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default looping and copying


The following snippet might be helpful

<snip
'move each keyword data to own sheet
Sheets.Add.Name = "keyword1"
Sheets.Add.Name = "keyword2"
Sheets.Add.Name = "keyword3"
'-------
For Each WS In Worksheets(Array("keyword1", "keyword2", "keyword3"))
WS.Range("A1:G1").Value = Sheets("Print").Range("A1:G1").Value 'copy title
row to each new page
Next
'-------
Sheets("inputdata").Activate
For Each cell In Range("G1:G" & Range("G65536").End(xlUp).Row) 'your
keyword column
Select Case cell.Value
Case "keyword1":
cell.EntireRow.Cut
Sheets("keyword1t").Range("A65536").End(xlUp).Offs et(1, 0)

Case "keyword2":
cell.EntireRow.Cut
Sheets("keyword2").Range("A65536").End(xlUp).Offse t(1, 0)

Case "keyword3":
cell.EntireRow.Cut
Sheets("keyword3").Range("A65536").End(xlUp).Offse t(1, 0)
End Select
Next
<end snip

"Juuljus" wrote in message
oups.com...
Hello,

I need to do a loop, that looks at keywords and then acording to them
copies the data to another sheet.
The table is something like that:

Keyword Text Value Value
key1 dog 1 3
key1 cat 3 4
key2 cow 9 8
key3 fox 44 5

So, the loop should look at the keywords, and then copy the data to
aother range (every keyword has it's own range).

Thanks to everyone who takes the time to reply.

Juuljus



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
Looping through my worksheet and copying cells a94andwi[_5_] Excel Programming 5 August 17th 05 12:45 AM
looping and copying from onesheet to othersheet Lolly[_2_] Excel Programming 0 August 22nd 04 03:07 PM
Looping down list and each time copying to another worksheet mattri Excel Programming 2 February 16th 04 06:26 PM
Looping down list and each time copying to another worksheet Matthew Richards Excel Programming 0 February 16th 04 04:58 PM
Nested Looping with Tests, Row Copying Macro Tom Gerber Excel Programming 3 October 16th 03 09:04 PM


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