Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Macro - Search one book, replace with data from another

I've exhausted my capabilities after hours of searching through threads.
I've done what I can, but am humbly seeking the advice of the experts. I'm
not very good with VBA and survive by copying tid-bits that I see in other
threads.

I'm developing an invoicing system which is comprised of two separate
workbookss:
1) Invoice Template
2) Invoice Listing

The Invoice template contains a lookup formula to the Invoice Listing to get
the next available invoice number. It also contains code to Paste that
Invoice # as values, then copy an entire row of signficant invoice data (Row
2 of Summary Sheet) to the Invoice Listing.

The Invoice Listing is a simple list of Row 2 of Summary Sheet from every
Invoice that is created.

I need a macro that allows for changes to the invoice data once it's saved
(i.e. extra billable hours, which changes information in Row 2 of Summary
Sheet). I'd like the macro to search for the invoice number from the Invoice
(Cell B1 of Invoice Sheet), search through the Invoice Listing, and replace
the entire row with the new data from Row 2 of Summary Sheet.

The Invoice Template contains the following code (probably totally
inefficient):

Sub AddtoList()

Sheets ("Invoice").Select
Range ("B1").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:xlNone,
SkipBlanks_:=False,Transpose:=False

Sheets("Summary").Select
Rows("2:2").Select
Selection.Copy

Workbooks.Open Filename:=_
"M:\ACCTS\TEMPLATES&FORMS\Invoicing\Invoice Listing.xls"
Range ("A1"). Select
Do
If IsEmpty(ActiveCell) = False Then
ActiveCell.Offset(1, 0).Select
End If
Loop Until IsEmpty(ActiveCell) = True
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
Skipblanks_:=False, Transpose:=False
ActiveWorkbook.Save
ActiveWindow.Close
End Sub

Thanks so much for any help that anyone can provide. I'm at my wits end :)
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
Macro Search and Replace [email protected] Excel Discussion (Misc queries) 2 September 23rd 08 01:13 PM
VB Macro to Automate a Search/Replace Lotus123 Excel Programming 5 June 7th 06 06:24 PM
Variable in a Search and Replace macro Sandy Excel Programming 4 April 25th 05 07:35 PM
Macro to Search and Replace Excel_Rookie[_3_] Excel Programming 1 September 23rd 04 05:09 PM
SEARCH & REPLACE MACRO Josh[_11_] Excel Programming 2 August 4th 04 05:07 PM


All times are GMT +1. The time now is 10:11 AM.

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"