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

Can you create a macro that will lookup a text string within the
spreadsheet, and if true copy that entire row to another spreadsheet
within the workbook?


---
Message posted from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Lookup Macro Trouble

Hi
see:
http://www.rondebruin.nl/copy5.htm

--
Regards
Frank Kabel
Frankfurt, Germany


Can you create a macro that will lookup a text string within the
spreadsheet, and if true copy that entire row to another spreadsheet
within the workbook?


---
Message posted from http://www.ExcelForum.com/

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,173
Default Lookup Macro Trouble

Jenn

The following is some starter code. It uses my Sheet1 (lookup sheet),
Sheet2 (Copy sheet). It will place the found row below the last one in the
copy sheet. (Presuming row 1 is headers)

It does no error checking past the searched item is found

Sub findAndMove()
Dim sData As String
Dim rFindRange As Range
Dim lLastRow As Long
sData = InputBox("Enter search string")
If Worksheets("Sheet1").Cells.Find(sData, , , xlWhole) Is Nothing Then
MsgBox "Search string not found", vbOKOnly
Exit Sub
End If
lLastRow = Worksheets("Sheet2").Range("A65536").End(xlUp).Row + 1
Set rFindRange = Worksheets("Sheet1").Cells.Find(sData, , , xlWhole)
rFindRange.EntireRow.Copy Destination:=Worksheets("Sheet2").Range("A" &
lLastRow)
End Sub


--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
HIS


"JennF " wrote in message
...
Can you create a macro that will lookup a text string within the
spreadsheet, and if true copy that entire row to another spreadsheet
within the workbook?


---
Message posted from
http://www.ExcelForum.com/



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
trouble with lookup in a range of cells. evilthorne Excel Worksheet Functions 5 September 28th 09 02:16 AM
Having trouble getting MATCH to work with a variable lookup array Chuck M Excel Worksheet Functions 3 August 20th 08 11:45 PM
trouble with text lookup ... help please William DeLeo Excel Discussion (Misc queries) 4 June 9th 06 07:09 PM
Trouble with hyhens within text when using LOOKUP Dennis via OfficeKB.com New Users to Excel 1 July 26th 05 10:00 PM
Macro trouble kdp Excel Programming 1 February 25th 04 10:25 PM


All times are GMT +1. The time now is 10:36 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"