Forum Discussion
KAM_Mumin
Oct 08, 2022Brass Contributor
MS Excel VBA Code .
Hi Everyone! I make a excel sheet for store stock maintain and there I put the data which I want to enter the right side table and there it's look like a slip table, now I need to put the next entry...
- Oct 08, 2022
In H7, enter the formula
=ROW(H7)-ROW(H$6)
This should propagate automatically to all existing and new rows of the table.
Macro:
Sub Add_To_Slip() Dim tb As ListObject Dim lr As ListRow Set tb = Range("H6").ListObject Set lr = tb.ListRows.Add Range("E6:E12").Copy lr.Range(1, 2).PasteSpecial _ Paste:=xlPasteValuesAndNumberFormats, _ Transpose:=True Application.CutCopyMode = False Range("E7").Select End Sub
HansVogelaar
Oct 08, 2022MVP
In H7, enter the formula
=ROW(H7)-ROW(H$6)
This should propagate automatically to all existing and new rows of the table.
Macro:
Sub Add_To_Slip()
Dim tb As ListObject
Dim lr As ListRow
Set tb = Range("H6").ListObject
Set lr = tb.ListRows.Add
Range("E6:E12").Copy
lr.Range(1, 2).PasteSpecial _
Paste:=xlPasteValuesAndNumberFormats, _
Transpose:=True
Application.CutCopyMode = False
Range("E7").Select
End SubKAM_Mumin
Oct 08, 2022Brass Contributor
Brother it's work. but now I have one thing to do that is the serial number how can i get the serial number auto after a data entry,,,