I am using the below code to import certain (dynamic)rows from a emailed sheet to a sheet on the next blank row
however when I am importing the date and time it is only pasting on the first row but not on subsequent rows if the initial import is multiple rows.
So I am trying to add the date and time and include the sheet name of the original sheet on all the rows of the import.
Sub copyMacroOSD()
Dim strName As String
Selection.Copy
Workbooks.Open fileName:="Z:\Test.xlsx"
On Error Resume Next
strName = InputBox(Prompt:=" Is this a Shortage or an Overage?. Type 1 for Short and 2 for Over", _
Title:="ENTER the Choice", Default:="none")
If strName = "Enter Choice here" Or _
strName = vbNullString Then
Exit Sub
Else
Select Case strName
Case "1"
Sheets("Short").Select
Sheets("Short").Range("B65536").End(xlUp).Offset(1, 0).PasteSpecial _
Paste:=xlPasteAll
Application.CutCopyMode = False
Sheets("Short").Range("A65536").End(xlUp).Offset(1, 0).Value = Date & " " & time
Case "2"
Sheets("Over").Select
Sheets("Over").Range("B65536").End(xlUp).Offset(1, 0).PasteSpecial _
Paste:=xlPasteAll
Application.CutCopyMode = False
Sheets("Over").Range("A65536").End(xlUp).Offset(1, 0) = Date & " " & time
End Select
End If
'ActiveWorkbook.Close SaveChanges:=True
End Sub
Bookmarks