Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Experts
This code keeps coming up with the error 'Mismatch' on line: Windows(outfile).Activate Does anyone know why? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sorry forgot code....!!!!
Sub Create_Remittance() For i = 4 To Sheets.Count Set sh = Sheets(i) sh.Activate File_Name = ActiveWorkbook.Worksheets("Menu").Cells.Range ("D9").Value Set outfile = Workbooks.Open(File_Name) Windows("Remittance Module.xls").Activate Range("B1").Copy Destination:=outfile.Worksheets ("Remittance").Range("B6") Range("C1").Copy Destination:=outfile.Worksheets ("Remittance").Range("B8") Range("F1").Copy Destination:=outfile.Worksheets ("Remittance").Range("B10") Range("A1:A" & Cells(Rows.Count, 1).End(xlUp).Row).Copy Destination:=outfile.Worksheets("Remittance").Rang e("A16") Range("D1:D" & Cells(Rows.Count, 1).End(xlUp).Row).Copy Destination:=outfile.Worksheets("Remittance").Rang e("B16") Range("G1:G" & Cells(Rows.Count, 1).End(xlUp).Row).Copy Destination:=outfile.Worksheets("Remittance").Rang e("C16") Range("H1:H" & Cells(Rows.Count, 1).End(xlUp).Row).Copy Destination:=outfile.Worksheets("Remittance").Rang e("D16") Windows(outfile).Activate Supp_Name = Range("B8") Trans_No = Range("B10") Trans_Date = Range("B6") ActiveWorkbook.SaveAs ("C:\Documents and Settings\ThoemmE1 \Desktop\Remittance Project\Remittance\" & Supp_Name & " " & Trans_No & " " & Trans_Date & ".xls") ActiveWorkbook.Close Next i ActiveWorkbook.Sheets("Menu").Select End Sub |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Answer would be the same
outfile.activate or Windows(outfile.name).Activate -- Regards, Tom Ogilvy "Edgar" wrote in message ... Sorry forgot code....!!!! Sub Create_Remittance() For i = 4 To Sheets.Count Set sh = Sheets(i) sh.Activate File_Name = ActiveWorkbook.Worksheets("Menu").Cells.Range ("D9").Value Set outfile = Workbooks.Open(File_Name) Windows("Remittance Module.xls").Activate Range("B1").Copy Destination:=outfile.Worksheets ("Remittance").Range("B6") Range("C1").Copy Destination:=outfile.Worksheets ("Remittance").Range("B8") Range("F1").Copy Destination:=outfile.Worksheets ("Remittance").Range("B10") Range("A1:A" & Cells(Rows.Count, 1).End(xlUp).Row).Copy Destination:=outfile.Worksheets("Remittance").Rang e("A16") Range("D1:D" & Cells(Rows.Count, 1).End(xlUp).Row).Copy Destination:=outfile.Worksheets("Remittance").Rang e("B16") Range("G1:G" & Cells(Rows.Count, 1).End(xlUp).Row).Copy Destination:=outfile.Worksheets("Remittance").Rang e("C16") Range("H1:H" & Cells(Rows.Count, 1).End(xlUp).Row).Copy Destination:=outfile.Worksheets("Remittance").Rang e("D16") Windows(outfile).Activate Supp_Name = Range("B8") Trans_No = Range("B10") Trans_Date = Range("B6") ActiveWorkbook.SaveAs ("C:\Documents and Settings\ThoemmE1 \Desktop\Remittance Project\Remittance\" & Supp_Name & " " & Trans_No & " " & Trans_Date & ".xls") ActiveWorkbook.Close Next i ActiveWorkbook.Sheets("Menu").Select End Sub |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Windows(outfile.name).Activate
-- Regards, Tom Ogilvy "Edgar" wrote in message ... Hi Experts This code keeps coming up with the error 'Mismatch' on line: Windows(outfile).Activate Does anyone know why? |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
or
Outfile.Activate -- Regards, Tom Ogilvy "Edgar" wrote in message ... Hi Experts This code keeps coming up with the error 'Mismatch' on line: Windows(outfile).Activate Does anyone know why? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Type mismatch... | Excel Discussion (Misc queries) | |||
Type Mismatch | Excel Worksheet Functions | |||
type mismatch--how to fix | Excel Discussion (Misc queries) | |||
Type Mismatch | Excel Programming |