• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Excel Database through Macro

Vishalunleashed

New Member
Hi Team,

I am in the process of creating a macro which will act as a database wherein the user can add the number of rows that one needs to scan and it will be added in another tab which will act as a database. There is certain information that I would like to iterate it multiple times based on # of devices. For instance number of devices is 7 then it should add that details 7 times. The macro runs fine the first time but when I rerun it again with new values then it replaces the data which is previously added.

Following is the code and I am also attaching the excel macro.

Sub Macro_DB()

Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Sheets("TVI#").Select
Range("A1").Select
Selection.End(xlDown).Select
Range("A1590").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("B1590").Select
ActiveWindow.SmallScroll Down:=12
Sheets("Input").Select
Range("C4").Select
Range(Selection, Selection.End(xlDown)).Select
Application.CutCopyMode = False
Selection.Copy
Sheets("TVI#").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=True
Selection.End(xlToLeft).Select
Selection.End(xlDown).Select
Range("B1594:G1594").Select
Range(Selection, Selection.End(xlUp)).Select
Application.CutCopyMode = False
Selection.FillDown
Range("A1594").Select
Selection.End(xlUp).Select
Range("A2").Select
Sheets("Input").Select
Range("L2").Select
Selection.Copy
Range("L3:L12").Select
ActiveSheet.Paste
Columns("M:M").Select
Selection.EntireColumn.Hidden = True
Range("L6").Select
Application.CutCopyMode = False
Range("C3").Select
End Sub

I would appreciate your help on this.

Kind Regards,
Vishal
 

Attachments

  • Macro_DB.xlsm
    122.8 KB · Views: 8
I have a hard time understanding your question.
This is my approach (see attached)
Does something like this work for you?
Groeten
 

Attachments

  • Macro_DB (Belle).xlsm
    35.4 KB · Views: 8
Thank you so much for prompt response Belleke; The input form looks very good. In this scenario the TVI# would be different as they are unique; rest of the information would remain the same and would be copy pasted. Basically, my team would be scanning the barcode which should automatically add the TVI numbers. Can we customize it that way?
 
Should be no problem.
So the team is using the scanner to fill your input sheet.
Do you have code how the input sheet is filled?
Are all the fields filled by scanning?
 
Once again thank you Belleke for prompt response!

Yes so the team would be manually scanning the hardware. Let me help you understand this through an example. Let's say there is a order number 900 and it has 10 different devices. For all these 10 devices the device id would be unique but rest of the information like customer, order number, Delivery date, stock, supplier, notes will remain the same. So when they add the number of devices of the order it should give some kind of a form where they can scan the devices and it can be added one by one into the database. After that if they want to search which particular device belongs to order number then they can search it in database and export the search to different excel. Whatever you have done so far its amazing and if you help us with it then I would highly appreciate your assistance.

Many Thanks!
 
Back
Top