Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
hello all,
I'm trying to prompt a user to open a workbook (and dim that filename) so data from multiple tabs can be copied to corresponding tabs in the current open workbook. The code would need to go back and forth between the workbooks to copy and paste multiple areas. I get a subscript out of range when I run this code from a module. Here is some of the code I have so far: Public Function RunPatch() Dim PatchFname As String PatchFname = Application.GetOpenFilename("Excel files (*.xls), *.xls") If PatchFname < "" Then Workbooks.Open PatchFname End If 'Wages Sheets("Wages").Select Range("A11:BG17").Select Selection.Copy Windows("1040 Workpapers V2.1.xls").Activate Sheets("Wages").Select Range("A11").Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False 'Dividends Windows(PatchFname).Activate Sheets("Interest & Dividends").Select Range("A17:C36").Select Selection.Copy Windows("1040 Workpapers V2.1.xls").Activate Range("A17").Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Please!! Thanks! |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Does this solve your problem? PatchFname = Application.GetOpenFilename("Excel files (*.xls), *.xls") If PatchFname < "" Then Workbooks.Open PatchFname PatchFname = ActiveWorkbook.Name End If TimT Wrote: hello all, I'm trying to prompt a user to open a workbook (and dim that filename) so data from multiple tabs can be copied to corresponding tabs in the current open workbook. The code would need to go back and forth between the workbooks to copy and paste multiple areas. I get a subscript out of range when I run this code from a module. Here is some of the code I have so far: Public Function RunPatch() Dim PatchFname As String PatchFname = Application.GetOpenFilename("Excel files (*.xls), *.xls") If PatchFname < "" Then Workbooks.Open PatchFname End If 'Wages Sheets("Wages").Select Range("A11:BG17").Select Selection.Copy Windows("1040 Workpapers V2.1.xls").Activate Sheets("Wages").Select Range("A11").Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False 'Dividends Windows(PatchFname).Activate Sheets("Interest & Dividends").Select Range("A17:C36").Select Selection.Copy Windows("1040 Workpapers V2.1.xls").Activate Range("A17").Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Please!! Thanks! -- Ikaabod ------------------------------------------------------------------------ Ikaabod's Profile: http://www.excelforum.com/member.php...o&userid=33371 View this thread: http://www.excelforum.com/showthread...hreadid=542129 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
That did it!
"Ikaabod" wrote: Does this solve your problem? PatchFname = Application.GetOpenFilename("Excel files (*.xls), *.xls") If PatchFname < "" Then Workbooks.Open PatchFname PatchFname = ActiveWorkbook.Name End If TimT Wrote: hello all, I'm trying to prompt a user to open a workbook (and dim that filename) so data from multiple tabs can be copied to corresponding tabs in the current open workbook. The code would need to go back and forth between the workbooks to copy and paste multiple areas. I get a subscript out of range when I run this code from a module. Here is some of the code I have so far: Public Function RunPatch() Dim PatchFname As String PatchFname = Application.GetOpenFilename("Excel files (*.xls), *.xls") If PatchFname < "" Then Workbooks.Open PatchFname End If 'Wages Sheets("Wages").Select Range("A11:BG17").Select Selection.Copy Windows("1040 Workpapers V2.1.xls").Activate Sheets("Wages").Select Range("A11").Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False 'Dividends Windows(PatchFname).Activate Sheets("Interest & Dividends").Select Range("A17:C36").Select Selection.Copy Windows("1040 Workpapers V2.1.xls").Activate Range("A17").Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Please!! Thanks! -- Ikaabod ------------------------------------------------------------------------ Ikaabod's Profile: http://www.excelforum.com/member.php...o&userid=33371 View this thread: http://www.excelforum.com/showthread...hreadid=542129 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
copy data for match word from one file to another file | Excel Worksheet Functions | |||
Copy data without opening file | Excel Programming | |||
copy data when enter the file name | Excel Programming | |||
How do I copy data from a cell in one file to another? | New Users to Excel | |||
Code to copy data from 1 file to another | Excel Programming |