LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Find existing number in another workbook

I am using vba code to copy data from various excel sheets to a master
(database) excel sheet. These are invoices that I track. I create the
invoices and then execute a macro to copy and paste the data to the
master sheet in the proper columns. Right now, I simply find the last
row with data and insert the new data into the next available row. I
would like to be able to check to see if the invoice number exists and
have a dialog box pop up and ask if the data should be overwritten. If
the result is yes, I would like to copy the new data over the existing
row of cells in the master sheet. I will paste my current code below.

On Error Resume Next
Workbooks.Open Filename:= _
"C:\...\Invoicing.xls"
Application.ScreenUpdating = False
ThisWorkbook.Activate
Application.Goto Reference:="Inv_Number"
Selection.Copy
Windows("Invoicing.xls").Activate
Sheets("Invoices").Select
Application.Goto Reference:="Invoice"
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
ThisWorkbook.Activate
Application.Goto Reference:="Cust_No"
Application.CutCopyMode = False
Selection.Copy
Windows("Invoicing.xls").Activate
ActiveCell.Offset(0, 1).Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
ThisWorkbook.Activate
Application.Goto Reference:="Cust_Name"
Application.CutCopyMode = False
Selection.Copy
Windows("Invoicing.xls").Activate
ActiveCell.Offset(0, 1).Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False

etc.

End Sub

Thanks in advance for any help with this!

 
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
Copy data from one workbook to another existing workbook Mads Excel Programming 3 August 17th 07 04:37 PM
Despite data existing in Excel 2002 spreadsheet Find doesn't find AnnieB Excel Discussion (Misc queries) 1 June 16th 06 02:15 AM
find the number of unique formattings applied to an workbook Deepa Excel Programming 2 February 13th 06 02:01 PM
Copy Sheet from One workbook to another EXISTING workbook Ken Soenen Excel Programming 0 February 12th 06 04:07 PM
Find an existing file. கற்பகம் Excel Programming 2 September 29th 05 06:57 PM


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