Copying data from various sheets (copying column till last cell with data) and pasting in master sheet (finding last non blank cell in column and past

vkexcelvba

New Member
Joined
Sep 19, 2018
Messages
1
Hi,

I have been trying to put a code which should:
Copy data from sheet (e.g. copy column A till last cell with data) to master sheet (in column A past the copied data in next available blank cell).
My source sheets keep changing so I have got workaround where i will rename the file and browse using below code:

Sub ImportDatafromSource()
Application.ScreenUpdating = False

Dim Master As Workbook
Dim Source As Workbook
Dim wbpath As String

' Master is active workbook where data will be copied from Source file

Set Master = ActiveWorkbook
wbpath = Application.GetOpenFilename

If wbpath = "False" Then
MsgBox ("No workbook selected, please select Source datafile"), vbInformation
Exit Sub
End If

'set Source as open workbook from where data will be copied

Set Source = Workbooks.Open(wbpath)

I have tried various mathods to find last empty cell but its not working as expected, please help.
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes

Forum statistics

Threads
1,223,909
Messages
6,175,313
Members
452,634
Latest member
cpostell

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