I worship at the fountain of your boolean minds:
I have two macro's for excel I want to pilfer, plunder and make
extremely good use of:
The first would dash through a sheet, looking for different names,
recognize 'Jane', 'Jim', or 'Josh' and 'highlight' the entire 'row; in
which their name appeared in col C: green, blue, or yellow.
The second macro would look at Column A, if it contained a '0', copy it
to 'Sheet 2' and then delete it from from sheet 1.
I may not be describing what I'm looking for very well, and if you can
point me to where they have been previously discussed, or create them
he you deserve praise and eternal life.
THANKS!Eternal life!!
for the 1st, look in vba help for FINDNEXT
for the 2nd, you just sort or filtergt;autofiltergt;for 0 and do your stuff.
--
Don Guillett
SalesAid Software
gt; wrote in message oups.com...
gt;I worship at the fountain of your boolean minds:
gt;
gt; I have two macro's for excel I want to pilfer, plunder and make
gt; extremely good use of:
gt;
gt; The first would dash through a sheet, looking for different names,
gt; recognize 'Jane', 'Jim', or 'Josh' and 'highlight' the entire 'row; in
gt; which their name appeared in col C: green, blue, or yellow.
gt;
gt; The second macro would look at Column A, if it contained a '0', copy it
gt; to 'Sheet 2' and then delete it from from sheet 1.
gt;
gt; I may not be describing what I'm looking for very well, and if you can
gt; point me to where they have been previously discussed, or create them
gt; he you deserve praise and eternal life.
gt;
gt; THANKS!
gt;
I'm just trying to autamaton the process to save some time.
For the second I'm looking at this, which was written for a string
search, and has an error message right now, so maybe someone can help
me out a bit on what it's doing wrong: I suppose I need to convert it
to a number search or something and add a Selection.delete... But I'm
just guessing as this is the second macro I've ever tried!
Still don't know about numero uno.Sub SearchForString()
Dim LSearchRow As Integer
Dim LCopyToRow As Integer
On Error GoTo Err_Execute
'Start search in row 2
LSearchRow = 2
'Start copying data to row 2 in Done (row counter variable)
LCopyToRow = 2
While Len(Range(quot;Aquot; amp; CStr(LSearchRow)).Value) gt; 0
'If value in column A = quot;0quot;, copy entire row to Sheet2
If Range(quot;Aquot; amp; CStr(LSearchRow)).Value = quot;0quot; Then
'Select row in Sheet1 to copy
Rows(CStr(LSearchRow) amp; quot;:quot; amp; CStr(LSearchRow)).Select
Selection.Copy'Paste row into Sheet2 in next row
Sheets(quot;Sheet2quot;).Select
Rows(CStr(LCopyToRow) amp; quot;:quot; amp; CStr(LCopyToRow)).Select
ActiveSheet.Insert
'Move counter to next row
LCopyToRow = LCopyToRow 1
'Go back to Sheet1 to continue searching
Sheets(quot;Sheet1quot;).Select
End If
LSearchRow = LSearchRow 1
Wend
'Position on cell A3
Application.CutCopyMode = False
Range(quot;A3quot;).Select
MsgBox quot;All matching data has been copied.quot;
Exit Sub
Err_Execute:
MsgBox quot;An error occurred.quot;
End Sub
- Nov 18 Sat 2006 20:10
Easy but I can't find it!
close
全站熱搜
留言列表
發表留言