Copying Macro help needed

R

Rescueme

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").Value
.Range("B" & iROW).Value =
ThisWorkbook.Worksheets("Invoice").Range("H13").Value 'Invoice Date
.Range("C" & iROW).Value =
ThisWorkbook.Worksheets("Invoice").Range("B11").Value 'Client Name
.Range("D" & iROW).Value =
ThisWorkbook.Worksheets("Invoice").Range("I44").Value 'Total
.Range("E" & iROW).Value =
ThisWorkbook.Worksheets("Invoice").Range("I41").Value 'SubTotal
.Range("F" & iROW).Value =
ThisWorkbook.Worksheets("Invoice").Range("I42").Value 'GST
.Range("G" & iROW).Value =
ThisWorkbook.Worksheets("Invoice").Range("I43").Value 'PST
.Range("H" & iROW).Value =
ThisWorkbook.Worksheets("Invoice").Range("A20").Value 'Shipping Date
.Range("I" & iROW).Value =
ThisWorkbook.Worksheets("Invoice").Range("G20").Value '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("INWorksheet").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").Range("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").Value = iINVOICE_NO + 1

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

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


End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top