Data Update using VBA

yogeshCR7

New Member
Joined
Mar 27, 2024
Messages
2
Office Version
  1. 365
  2. 2021
  3. 2019
  4. 2016
Platform
  1. Windows
Hello Everyone!

I have two files named Purchase Requistion (PR) and Database (DB). PR is in the format of a form which they fill in order to raise a PR request. This file is then "Save As" with a different name so as not to disturb the native file "PR".
DB is a table format, which takes the data from the cells and creates a order number.

I have written a VBA code for reflecting, the data from PR to DB. Put as soon as the PR file is saved as with another name, the new data file in the PR file gets reflected in the same cells in the DB file, basically overwrites the previous data.

Requirement :
1. There is are multiple checkboxes in the PR file, I want to reflect that data in the DB file. I wrote a code for that, it seems to work but when a user clicks on other checkbox it does not update or when its unchecked the data still remains in its place. What is missing or incorrect?
Sub CheckBox10_Click()
If Check_Box_10 = False Then
Workbooks("DB.xlsm").Worksheets("Sheet1").Range("A4").Value = "Betriebsstoffe"
Else
Workbooks("DB.xlsm").Worksheets("Sheet1").Range("A4").Value = " "
End If
End Sub
2. I want to update the DB in such a way that the previous data is intact and the new data gets reflect in the empty column after the previous data. To find the new empty row I have written a code so that is solved.

If you want me to put the whole code, let me know
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).

Forum statistics

Threads
1,223,888
Messages
6,175,205
Members
452,618
Latest member
Tam84

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top