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: 1
Default coping rows using a loop... please advise




Hello everyone i have a problem with a macro i am creating. There i
probably a really easy answer to this question, but i cant figure i
out. I need to know how to only copy the 4 rows following the cel
that contains "station number". These rows then need to be paste
into a new worksheet. This process must be done 12 times per wor
sheet. There are 12 cells containing the text "station number" and
need the 4 rows after each one. There are also numerous worksheet
that need to be procecced in the same manner. If anyone could help i
would be greatly appreciated.

P.S. I managed to create the code shown below. I dont know how muc
of it is correct. This is my first attempt at writing a macro :)


Dim Snum As Integer
Dim xi As Integer

Snum = 0
xi = 0
If (BSnum = STATION_NAME) Then
Range("B" & Snum :"BI" & (Snum + 3)").Select
Selection.Copy
Sheets("Sheet1").Select
Range("B" & xi).Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone
SkipBlanks:= _
False, Transpose:=False
xi = xi + 4
Else
Snum = Snum + 1
End I

--
jim hense
-----------------------------------------------------------------------
jim hensen's Profile: http://www.excelforum.com/member.php...fo&userid=1515
View this thread: http://www.excelforum.com/showthread.php?threadid=26889

 
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
need help with coping rows Emac39 Excel Worksheet Functions 0 December 11th 08 02:28 AM
Loop relative rows PST Excel Discussion (Misc queries) 1 May 20th 07 12:23 PM
Help with Do Loop that names rows as ranges fifthhorseman[_2_] Excel Programming 1 August 19th 04 04:12 PM
loop to delete rows... Froglegz Excel Programming 5 August 1st 04 09:56 PM
Cannot loop through rows in C# Howard Excel Programming 2 February 5th 04 03:39 PM


All times are GMT +1. The time now is 07:15 PM.

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"