Carlit007
New Member
- Joined
- Sep 5, 2018
- Messages
- 47
- Office Version
- 2019
- 2016
- 2013
- Platform
- Windows
- MacOS
Hi just checking If anybody can help be with this as I have a long way to go
I have a simple VBA code that lets you import data from another workbook into active workbook by using the file open dialog.
currently the code just clears the sheet and imports all the data into active workbook.
I would like to be able to import new data onto an existing database I have built to track equipment location based on Serial numbers
this database looks similar to the one listed below (with a few other columns to track the equipment location)
I want to be able to click on a button and get the fileopen dialog to let me open and import from another report that has both a mix of new & old equipment this report changes very so often and I just want to grab whatever is new to be able to track.
Note every item has a unique Serial number on column ( A) If the data already exist on my equipment tracker database I would like for it to not be added/Overwritten when imported from the new sheet with the opefile dialog a bonus would be to include the date added for every new item on column G
Ideally I would like to use a Dictionary but am open for any other solution
the code that I'm currently using to import is as follow;
Looking forward to seeing what the best way to solve this VBA problem is
thanks in advance
I have a simple VBA code that lets you import data from another workbook into active workbook by using the file open dialog.
currently the code just clears the sheet and imports all the data into active workbook.
I would like to be able to import new data onto an existing database I have built to track equipment location based on Serial numbers
this database looks similar to the one listed below (with a few other columns to track the equipment location)
SERIAL NUMBER | LIN | MATERIAL | DESCRYPTION | ADMIN | LOCATION | DATE ADDED |
2HH1GK2 | 70209N | 01C945562 | COMPUTER 7050 | NGMAMDLC3WK01 | ROOM 111 | 12/25/2021 |
2UA64134QK | 70209N | 01X409459 | COMPUTER HP PRODESK 600 G2 SFF | NGMAWK244700001 | ROOM 210 | 5/4/2020 |
2UA64134QP | 70209N | 01X409459 | COMPUTER HP PRODESK 600 G2 SFF | NGMAWK244700002 | ROOM 110 | 4/11/2019 |
2UA64035R4 | 70209N | 01X409459 | COMPUTER HP PRODESK 600 G2 SFF | NGMAWK301700001 | ROO 119 | 8/7/2021 |
I want to be able to click on a button and get the fileopen dialog to let me open and import from another report that has both a mix of new & old equipment this report changes very so often and I just want to grab whatever is new to be able to track.
Note every item has a unique Serial number on column ( A) If the data already exist on my equipment tracker database I would like for it to not be added/Overwritten when imported from the new sheet with the opefile dialog a bonus would be to include the date added for every new item on column G
Ideally I would like to use a Dictionary but am open for any other solution
the code that I'm currently using to import is as follow;
VBA Code:
Sub ImportNewEquip()
Dim Fname As Variant
Dim Wbk As Workbook
Dim Ws As Worksheet
Set Ws = ActiveSheet
Fname = Application.GetOpenFilename
If Fname = "" Then Exit Sub
Set Wbk = Workbooks.Open(Fname)
Ws.UsedRange.Offset(1).Clear
Wbk.Sheets("Sheet1").UsedRange.Offset(1).Copy Ws.Range("A2")
Wbk.Close False
End Sub
Looking forward to seeing what the best way to solve this VBA problem is
thanks in advance