mszakalinski
New Member
- Joined
- Oct 29, 2013
- Messages
- 3
hi,
im facing problem operating between two different unsaved workbooks, read a lot about possible solutions but still cant find good one. Macro should select and copy sheets to a new added workbook or opened from file workbook (both workbooks have sheet kennzahlen), switching between those workbooks is for me unclear, can anyone have a look why this code doesnt work? i set wwb1 and wwb2 as public to use them in other macros this module
Public wwb1 As Workbook
Public wwb2 As Workbook
Sub macro1()
Set wwb1 = ActiveWorkbook
wwb1.Activate
wwb1.Sheets("Kennzahlen").Select
ActiveSheet.Cells.Copy
Set wbb2 = Workbooks.Open(Filename:= _
"C:\Users\sds\Desktop\Moje dokumenty\1.xls")
wwb1.Sheets("Kennzahlen").Activate
wwb2.Sheets("Kennzahlen").Activate
wwb1.Sheets("Kennzahlen").Activate
im facing problem operating between two different unsaved workbooks, read a lot about possible solutions but still cant find good one. Macro should select and copy sheets to a new added workbook or opened from file workbook (both workbooks have sheet kennzahlen), switching between those workbooks is for me unclear, can anyone have a look why this code doesnt work? i set wwb1 and wwb2 as public to use them in other macros this module
Public wwb1 As Workbook
Public wwb2 As Workbook
Sub macro1()
Set wwb1 = ActiveWorkbook
wwb1.Activate
wwb1.Sheets("Kennzahlen").Select
ActiveSheet.Cells.Copy
Set wbb2 = Workbooks.Open(Filename:= _
"C:\Users\sds\Desktop\Moje dokumenty\1.xls")
wwb1.Sheets("Kennzahlen").Activate
wwb2.Sheets("Kennzahlen").Activate
wwb1.Sheets("Kennzahlen").Activate