Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
VBA code question
I'm new to VBA and have been using macros by recording them. I don't know how
to approach this... What would code look like if it needed to: Proceed down a column until it hits a cell with the second instance of the word "QUALITY". Then that entire row is copied to the preceeding worksheet, and then returns to the same cell it found the second word "QUALITY" in. Thanks for your insights. |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
VBA code question
If the data is on Sheet2 and the preceeding sheet is Sheet1:
Sub JEV() k = 0 Set r = Range("A:A") For Each rr In r If rr.Value = "QUALITY" Then k = k + 1 If k = 2 Then Set rf = rr.EntireRow Set rt = Sheets("Sheet1").Range("A1") rf.Copy rt rr.Select Exit Sub End If End If Next End Sub -- Gary''s Student gsnu200708 "JEV" wrote: I'm new to VBA and have been using macros by recording them. I don't know how to approach this... What would code look like if it needed to: Proceed down a column until it hits a cell with the second instance of the word "QUALITY". Then that entire row is copied to the preceeding worksheet, and then returns to the same cell it found the second word "QUALITY" in. Thanks for your insights. |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
VBA code question
For Each cell In Columns(1) If cell.Value = "QUALITY" then If fOneFound Then cell.Copy Worksheets("Sheet1").Range("A1") Exit For Else fOneFound = TRUE End If End If Next cell is one way -- --- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "JEV" wrote in message ... I'm new to VBA and have been using macros by recording them. I don't know how to approach this... What would code look like if it needed to: Proceed down a column until it hits a cell with the second instance of the word "QUALITY". Then that entire row is copied to the preceeding worksheet, and then returns to the same cell it found the second word "QUALITY" in. Thanks for your insights. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Code question for clearing a command checkbox. | Excel Discussion (Misc queries) | |||
a tough question - calculating a number out of an alphanumeric code | Excel Discussion (Misc queries) | |||
question about excessive code in replacing #N/A when using VLOOKUP | Excel Discussion (Misc queries) | |||
Easy VB code question | Excel Discussion (Misc queries) | |||
syntax question - cell references in VB code | New Users to Excel |