Re: MS excel reportings, presentations, and vba helping thre
patulong po, may macro code po ako, and ang function nya is to save yung inutted data to another sheet WITHIN the same workbook. Pero ang gusto ko sana mangyari, yung inputted data ko sa ibang WORKBOOK magsasave, patulong po sana ako.
Code:
patulong po, may macro code po ako, and ang function nya is to save yung inutted data to another sheet WITHIN the same workbook. Pero ang gusto ko sana mangyari, yung inputted data ko sa ibang WORKBOOK magsasave, patulong po sana ako.
Code:
Sub RoundedRectangle1_Click()
Dim i, lastrow As Long
If ActiveSheet.Range("d6") = "" Or ActiveSheet.Range("g6") = "" Or ActiveSheet.Range("c9") = "" Then
MsgBox "Please complete all fields!"
Exit Sub
End If
lastrow = Sheets("database").Cells(Cells.Rows.Count, 2).End(xlUp).Row + 1
i = 9
Do While Cells(i, 3) <> "" And i < 29
Sheets("Database").Cells(lastrow, 2) = ActiveSheet.Range("g6") ' Date
Sheets("Database").Cells(lastrow, 3) = ActiveSheet.Range("d6") ' Ref
Sheets("Database").Cells(lastrow, 4) = ActiveSheet.Cells(i, 3) ' Code
Sheets("Database").Cells(lastrow, 5) = ActiveSheet.Cells(i, 4) ' Description
Sheets("Database").Cells(lastrow, 6) = ActiveSheet.Cells(i, 5) ' U/M
Sheets("Database").Cells(lastrow, 7) = ActiveSheet.Cells(i, 6) ' Qty
Sheets("Database").Cells(lastrow, 8) = ActiveSheet.Cells(i, 7) ' Price
Sheets("Database").Cells(lastrow, 9) = "IN" ' Transaction
i = i + 1
lastrow = lastrow + 1
Loop
MsgBox "Saved Succesfully!"
ThisWorkbook.Save
Call RoundedRectangle2_Click
End Sub