Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Conditional Lookup and copy loop between worksheets

Can anyone point me in the right direction to achieve the following

1 Workbook
2 Work sheets

Sheet 1

A1 - Txt1 Title
B1 - Txt2 Title
C1 - Val1 Title

A2A? - Txt1 TextString
B2B? - Txt2 Textstring
C2C? - Val1 (Null, 0,1 or 999)

? - min of 2, max unknown


Sheet 2

Command button to do the following

counter = 2
Loop until Sheet1-Ccounter = 999
Examine Sheet1-Ccounter
If Sheet1-Ccounter = 1
then
copy Sheet1-Acounter contents to Sheet2-Gcounter
copy Sheet1-Bcounter contents to Sheet2-Hcounter
counter = counter + 1
else
counter = counter+1

Thank you






  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 812
Default Conditional Lookup and copy loop between worksheets

I wasn't exactly clear on what you wanted, but the
following should put you close.

Merjet

Private Sub CommandButton1_Click()
Dim iCt1 As Integer
Dim iCt2 As Integer
iCt1 = 1
iCt2 = 1
Sheets("Sheet2").UsedRange.Clear
Do
iCt1 = iCt1 + 1
If Sheets("Sheet1").Cells(iCt1, 3) = 1 Then
iCt2 = iCt2 + 1
Sheets("Sheet1").Range("A" & iCt2 & ":C" & iCt2).Copy _
Destination:=Sheets("Sheet2").Range("A" & iCt2)
End If
Loop Until Sheets("Sheet1").Cells(iCt1, 3) = ""

End Sub


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
compare cells, copy, loop Immortal_Creations Excel Worksheet Functions 2 July 17th 09 03:34 PM
VBA Loop to Find then Copy & Paste B J Hankinson Excel Discussion (Misc queries) 0 April 15th 09 06:39 PM
Loop worksheets merry_fay Excel Discussion (Misc queries) 2 January 7th 09 01:54 PM
Find and Copy loop problem BillyJ Excel Discussion (Misc queries) 3 November 2nd 05 07:16 PM
search & copy with loop Don Guillett[_4_] Excel Programming 0 July 24th 03 02:55 PM


All times are GMT +1. The time now is 12:24 PM.

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"