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

Thanks in advance to any one that can help. Karen

I have a macro in a spreadsheet that works fine (copy below). I need a
similar Macro in the same workbook to SAVE_CONFIRMATION and
SET_CONFIRMATION. I have two new sheets in the workbook Confirmation (which
is the same as the invoice) and COWorksheet (which is the same idea as
INWorksheet). My Invoice sheet has a button at the bottom to Save Invoice, I
want to make a similar button on the bottom of my Confrimation sheet to Save
Confirmation but I can't seem to access the button that copied over to
change the wording etc. I have no problem changing the information that is
being saved by the Macro, but I am not able to get the new macro set up to
start, I had help with the initial setup of the first and the creation of
the Button to save it.

Public Sub SAVE_INVOICE()

'write invoice details to worksheet..
With ThisWorkbook.Worksheets("INWorksheet")
.Range("A" & iROW).Value =
ThisWorkbook.Worksheets("Invoice").Range("I1").Val ue
.Range("B" & iROW).Value =
ThisWorkbook.Worksheets("Invoice").Range("H13").Va lue 'Invoice Date
.Range("C" & iROW).Value =
ThisWorkbook.Worksheets("Invoice").Range("B11").Va lue 'Client Name
.Range("D" & iROW).Value =
ThisWorkbook.Worksheets("Invoice").Range("I44").Va lue 'Total
.Range("E" & iROW).Value =
ThisWorkbook.Worksheets("Invoice").Range("I41").Va lue 'SubTotal
.Range("F" & iROW).Value =
ThisWorkbook.Worksheets("Invoice").Range("I42").Va lue 'GST
.Range("G" & iROW).Value =
ThisWorkbook.Worksheets("Invoice").Range("I43").Va lue 'PST
.Range("H" & iROW).Value =
ThisWorkbook.Worksheets("Invoice").Range("A20").Va lue 'Shipping Date
.Range("I" & iROW).Value =
ThisWorkbook.Worksheets("Invoice").Range("G20").Va lue 'FOB Terms


End With
End Sub

Public Sub SET_INVOICE()
Dim iFlag As Integer 'counter
Dim iINVOICE_NO As Integer

'this code will auto - generate the next Invoice No. and put the detail
into 'INWORKSHEET'

'turn off screen updating so theres no flickering...
Application.ScreenUpdating = False

'first empty row = iROW
iROW =
Application.CountA(ThisWorkbook.Worksheets("INWork sheet").Range("A1:A60000"),
0)

'need to keep iROW, so assign value to iFlag
iFlag = iROW - 1

'now see if the entry in the last cell in Col A is numeric....loop until
you find a number...
Do Until IsNumeric(ThisWorkbook.Worksheets("INWorksheet").R ange("A" &
iFlag).Value)
iFlag = iFlag - 1
Loop

iINVOICE_NO = ThisWorkbook.Worksheets("INWorksheet").Range("A" &
iFlag).Value

'put the NEW invoice number into the Invoice
ThisWorkbook.Worksheets("Invoice").Range("I1").Val ue = iINVOICE_NO + 1

'default todays date on the invoice
ThisWorkbook.Worksheets("Invoice").Range("H13").Va lue = Date

'now turn screen updating back on to see results
Application.ScreenUpdating = True


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
Copying Macro Needed John Calder New Users to Excel 2 November 4th 09 05:19 AM
Help Needed With Copying Formulas [email protected] Excel Worksheet Functions 6 April 11th 08 05:59 AM
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
Macro needed to Paste Values and prevent Macro operation thunderfoot Excel Discussion (Misc queries) 1 June 11th 05 12:44 AM
Macro needed to Paste Values and prevent Macro operation thunderfoot Excel Discussion (Misc queries) 0 June 10th 05 03:38 PM


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