Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro Error
I have the following Macro (BELOW) in a workbook. It
works in opening the daily updated workbook "degreedays.xls" but what I want is this workbook to open in another workbook when the user runs the macro on the worksheet "Weather" in the ddays.xls workbook. Thanks in advance for looking at my problem. Krefty Option Explicit Sub Macro1() Dim destCell As Range Dim degreedays As Workbook With Workbooks("ddays.xls").Worksheets("Weather") .UsedRange.Clear Set destCell = .Cells(.Rows.Count, "A").End (xlUp).Offset(1, 0) End With Workbooks.OpenText Filename:="G:\Gas_Control\EXCEL\DEPT\Month Reports\degreedays.xls", _ Origin:=xlWindows, _ StartRow:=1, DataType:=xlFixedWidth, _ FieldInfo:=Array(Array(0, 1), Array(8, 1), _ Array(30, 1), Array(41, 1), Array(67, 1), Array (78, 1)) End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro Error
Sub Macro1()
Dim destCell As Range Dim degreedays As Workbook With Workbooks("ddays.xls").Worksheets("Weather") .UsedRange.Clear Set destCell = .Cells(.Rows.Count, "A").End (xlUp).Offset(1, 0) End With Workbooks.OpenText Filename:="G:\Gas_Control\EXCEL\DEPT\Month Reports\degreedays.xls", _ Origin:=xlWindows, _ StartRow:=1, DataType:=xlFixedWidth, _ FieldInfo:=Array(Array(0, 1), Array(8, 1), _ Array(30, 1), Array(41, 1), Array(67, 1), Array (78, 1)) ActiveSheet.Range("A1").CurrentRegion.Copy _ Destination:=destCell ActiveWorkbook.Close Savechanges:=False End Sub Regards, Tom Ogilvy "Krefty" wrote in message ... I have the following Macro (BELOW) in a workbook. It works in opening the daily updated workbook "degreedays.xls" but what I want is this workbook to open in another workbook when the user runs the macro on the worksheet "Weather" in the ddays.xls workbook. Thanks in advance for looking at my problem. Krefty Option Explicit Sub Macro1() Dim destCell As Range Dim degreedays As Workbook With Workbooks("ddays.xls").Worksheets("Weather") .UsedRange.Clear Set destCell = .Cells(.Rows.Count, "A").End (xlUp).Offset(1, 0) End With Workbooks.OpenText Filename:="G:\Gas_Control\EXCEL\DEPT\Month Reports\degreedays.xls", _ Origin:=xlWindows, _ StartRow:=1, DataType:=xlFixedWidth, _ FieldInfo:=Array(Array(0, 1), Array(8, 1), _ Array(30, 1), Array(41, 1), Array(67, 1), Array (78, 1)) End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
I tried to get around the problem of the pivot table field settingdefaulting to Count instead of Sum by running a macro of change the settingfrom Count to Sum. However, when I tried to run the Macro, I got error messageof run time error 1004, unable | Excel Worksheet Functions | |||
I tried to get around the problem of the pivot table field settingdefaulting to Count instead of Sum by running a macro of change the settingfrom Count to Sum. However, when I tried to run the Macro, I got error messageof run time error 1004, unable | Excel Discussion (Misc queries) | |||
Macro error | Excel Discussion (Misc queries) | |||
Macro error : Application-defined or object-defined error | Excel Discussion (Misc queries) | |||
Excel 2003 Macro Error - Runtime error 1004 | Excel Discussion (Misc queries) |