Paste Vales in same row, different columns

muzaffas

New Member
Joined
Nov 5, 2014
Messages
5
Hello, I would like to paste 3 values in 3 columns A, B, and C in the last available row.

Filename = Dir(Path & "*.xls*")
DateTimeStamp = DateTime.Now
UserName = (Environ$("Username"))
'get last AVAILABLE cell to paste into
Set iLastCellS2 = s2.Cells(s2.Rows.Count, "A").End(xlUp).Offset(1, 0)

Assume my available row is row #5 . How do I paste Filename in A5, DateTimeStamp in B5, and UserName in C5?

Appreciate your help
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
How about
Code:
iLastCellS2.Resize(, 3).Value = Array(Filename, DateTimeStamp, UserName)
 
Upvote 0
Try:

Code:
Filename = Dir(Path & "*.xls*")
DateTimeStamp = DateTime.Now
UserName = (Environ$("Username"))
s2.Cells(Rows.Count, "A").End(xlUp)(2).Resize(, 3).Value = Array(Filename, DateTimeStamp, UserName)
 
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0
I'm glad to help you. Thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,314
Messages
6,124,204
Members
449,147
Latest member
sweetkt327

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top