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


I have a spreadsheet from A2 to Z1500 and want to find the word "orde
form" which then has a number after it. The word "order form" is in
various locations all over the spreadsheet with different numbers
after each "order form".

I want to loop thru the entire spreadsheet and copy and paste eac
instance of "order form"and its unique number to sheet 2 starting at A
on down.



Thanks in advanc

--
ligh
-----------------------------------------------------------------------
light's Profile: http://www.excelforum.com/member.php...nfo&userid=722
View this thread: http://www.excelforum.com/showthread.php?threadid=39611

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Simple looping question


I'd just saw your message. Do you still need this. I'm learning myself.

Sub CopyOrderForm()

Dim rngCell As Range 'each cell
Dim rngWork As Range 'working range
Dim lngCopyPos As Long 'copy position row

Set rngWork = Range("A1:Z1500")
lngCopyPos = 2
For Each rngCell In rngWork
If Left(rngCell.Value, 10) = "order form" Then
Sheets("Sheet2").Cells(lngCopyPos, "A") = rngCell.Value
lngCopyPos = lngCopyPos + 1
End If
Next

Set rngWork = Nothing

End Su

--
hidek
-----------------------------------------------------------------------
hideki's Profile: http://www.excelforum.com/member.php...fo&userid=1890
View this thread: http://www.excelforum.com/showthread.php?threadid=39611

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Simple looping question


Thanks hideki

It works fine except I neglected to say that Instead of it
reading left to right by rows,I need it to read top to bottom by
columns.


--
light
------------------------------------------------------------------------
light's Profile: http://www.excelforum.com/member.php...fo&userid=7228
View this thread: http://www.excelforum.com/showthread...hreadid=396118

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
IF formula-simple question; simple operator Rich D Excel Discussion (Misc queries) 4 December 6th 07 03:36 PM
Simple looping question light Excel Programming 2 August 16th 05 06:30 PM
Simple Simple Excel usage question BookerW Excel Discussion (Misc queries) 1 June 23rd 05 10:06 PM
Simple Array Looping Nikky Excel Programming 2 April 20th 05 10:38 PM
Looping Question MWS Excel Programming 3 November 12th 04 05:32 PM


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