rizalyaakub
New Member
- Joined
- Nov 6, 2022
- Messages
- 3
- Office Version
- 2021
- Platform
- Windows
I am rather new at VBA. Mostly learning it via youtube video.
I need a little guidance for VBA code that would allow me,
1. When I click the "UPDATE RECEIPT" button, it adds / updates value marked as A (in the RECEIPT sheet) to ROW C in the DATABASE sheet based on corresponding Invoice number marked as B
I found a previous posting online and tried using it as based but failed miserably.
Really need your help
I need a little guidance for VBA code that would allow me,
1. When I click the "UPDATE RECEIPT" button, it adds / updates value marked as A (in the RECEIPT sheet) to ROW C in the DATABASE sheet based on corresponding Invoice number marked as B
I found a previous posting online and tried using it as based but failed miserably.
VBA Code:
Option Explicit
Dim x As Integer
Sub Button1_Click()
x = 1
'this will find the column that matches the date and stores that as the copy location.
While Sheets("Sheet2").Cells(1, x).Value <> Sheets("Sheet1").Range("L8")
x = x + 1
Wend
'this portion copies the data to the designated coordinates found by the first portion and delete the information from L8 and L11.
Sheets("Sheet2").Cells(2, x).Value = Sheets("Sheet1").Range("L11").Value
Sheets("Sheet1").Range("L8").Value = ""
End Sub
Really need your help