JACOBB9900
New Member
- Joined
- Apr 8, 2019
- Messages
- 38
I'm a total green horn to VBA so I used "Record Macro" to do what I needed to do. I'll first explain what I'm trying to do. I have an "Inventory Dashboard" tab and a "Stock Tracker" tab. I created this so our employees can check items out of our stock room. The "Dashboard" tab is locked with only the required cells that need to be filled left unlocked, for example, the description, P/N, and employee name. I placed a "Submit" button with the macro attached to it so once they fill the sheet out they click the button and the macro copies the information from the Dashboard tab and pastes it into the stock tab top to bottom, then deletes the information in the Dashboard tab to make room for a new entry. The issue I'm having is that it only pastes to the first row. I need the macro to paste the data into the next empty row below so I can keep a count of what has been checked out of the stock room. The macro I have is pasted below. Please let me know if there is any other information you could use from me to help in this situation.
Thank you.
Sub Copy_to_Stock()
'
' Copy_to_Stock Macro
' Copies data from Dashboard and pastes it into stock tab then deletes data in Dashboard.
'
'
Range("D10").Select
Selection.Copy
Sheets("Stock").Select
Range("C8").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Dashboard").Select
Range("D13").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Stock").Select
Range("D8").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Dashboard").Select
Range("F16").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Stock").Select
Range("E8").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Dashboard").Select
Range("D16").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Stock").Select
Range("F8").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Dashboard").Select
Range("F13").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Stock").Select
Range("G8").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Dashboard").Select
Range("F16").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Stock").Select
Range("H8").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Dashboard").Select
Range("D10,D13,D16,F10,F13,F16").Select
Range("F16").Activate
Application.CutCopyMode = False
Selection.ClearContents
End Sub
Thank you.
Sub Copy_to_Stock()
'
' Copy_to_Stock Macro
' Copies data from Dashboard and pastes it into stock tab then deletes data in Dashboard.
'
'
Range("D10").Select
Selection.Copy
Sheets("Stock").Select
Range("C8").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Dashboard").Select
Range("D13").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Stock").Select
Range("D8").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Dashboard").Select
Range("F16").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Stock").Select
Range("E8").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Dashboard").Select
Range("D16").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Stock").Select
Range("F8").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Dashboard").Select
Range("F13").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Stock").Select
Range("G8").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Dashboard").Select
Range("F16").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Stock").Select
Range("H8").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Dashboard").Select
Range("D10,D13,D16,F10,F13,F16").Select
Range("F16").Activate
Application.CutCopyMode = False
Selection.ClearContents
End Sub