Team,
I have simple macro:
- open two workbooks
- from "Sheet1" copy range to "Sheet1" second sheet.
It works fine, but when macro paste the values, height & width columns are difrent like in the source sheets.
I want to have this some format in both sheets.
My code:
thanks for your all comments and support,
regards,
PvK
I have simple macro:
- open two workbooks
- from "Sheet1" copy range to "Sheet1" second sheet.
It works fine, but when macro paste the values, height & width columns are difrent like in the source sheets.
I want to have this some format in both sheets.
My code:
Code:
MsgBox "Otowrz dokument gdzie maja zostac skopiowane dane"
Application.Dialogs(xlDialogOpen).Show
temp = ActiveWorkbook.Name
MsgBox "Otworz plik z danymi"
Application.Dialogs(xlDialogOpen).Show
my_data = ActiveWorkbook.Name
'------------------------------------------
Workbooks(my_data).Worksheets("Sheet1").Activate
x_columns = Application.WorksheetFunction.CountA(Rows(1))
y_last_cell = Cells(65536, x_columns).End(xlUp).Row
Range(Cells(1, 1), Cells(y_last_cell, x_columns)).Copy
'------------------------------------------
Workbooks(temp).Worksheets("Sheet1").Activate
Range("A3").PasteSpecial (xlPasteAll)
thanks for your all comments and support,
regards,
PvK