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
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