Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
 
Posts: n/a
Default Easy but I can't find it!

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!

  #3   Report Post  
Posted to microsoft.public.excel.misc
 
Posts: n/a
Default Easy but I can't find it!

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("A" & CStr(LSearchRow)).Value) 0

'If value in column A = "0", copy entire row to Sheet2
If Range("A" & CStr(LSearchRow)).Value = "0" Then

'Select row in Sheet1 to copy
Rows(CStr(LSearchRow) & ":" & CStr(LSearchRow)).Select
Selection.Copy


'Paste row into Sheet2 in next row
Sheets("Sheet2").Select
Rows(CStr(LCopyToRow) & ":" & CStr(LCopyToRow)).Select
ActiveSheet.Insert

'Move counter to next row
LCopyToRow = LCopyToRow + 1



'Go back to Sheet1 to continue searching
Sheets("Sheet1").Select

End If

LSearchRow = LSearchRow + 1

Wend

'Position on cell A3
Application.CutCopyMode = False
Range("A3").Select

MsgBox "All matching data has been copied."

Exit Sub

Err_Execute:
MsgBox "An error occurred."

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
Find and Replace blakrapter Excel Worksheet Functions 3 December 15th 05 12:25 AM
Code needed to find records from bottom up Andy Excel Discussion (Misc queries) 4 December 5th 05 03:27 AM
Using the Find tool in EXCEL TK Excel Worksheet Functions 2 February 11th 05 07:51 PM
Find & Replace results to display specified chosen fields samuel Excel Discussion (Misc queries) 1 December 28th 04 08:43 AM
VB Find and Replace Bony_Pony Excel Worksheet Functions 10 December 6th 04 05:45 PM


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