Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The following code is failing on the last line. Has anyone any ideas?
Dim TargetSheet As Worksheet Set TargetSheet = Application.Workbooks("Summary.xls").Worksheets ("Sheet3") 'Add column headings TargetSheet.Range(Cells(1, 1)).Value = "Disease Group" In other posts I have seen people were helped out by qualifying the cells method with the range, but when I substitute the last line with: TargetSheet.Range(TargetSheet.Cells(1, 1)).Value = "Disease Group" it still fails on that line with the same error. Kind regards, John |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Maybe...
TargetSheet.Cells(1, 1).Value = "Disease Group" or TargetSheet.Range("A1").Value = "Disease Group" wrote: The following code is failing on the last line. Has anyone any ideas? Dim TargetSheet As Worksheet Set TargetSheet = Application.Workbooks("Summary.xls").Worksheets ("Sheet3") 'Add column headings TargetSheet.Range(Cells(1, 1)).Value = "Disease Group" In other posts I have seen people were helped out by qualifying the cells method with the range, but when I substitute the last line with: TargetSheet.Range(TargetSheet.Cells(1, 1)).Value = "Disease Group" it still fails on that line with the same error. Kind regards, John -- Dave Peterson |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Mar 6, 12:17*pm, Dave Peterson wrote:
Maybe... TargetSheet.Cells(1, 1).Value = "Disease Group" or TargetSheet.Range("A1").Value = "Disease Group" wrote: The following code is failing on the last line. *Has anyone any ideas? Dim TargetSheet As Worksheet Set TargetSheet = Application.Workbooks("Summary.xls").Worksheets ("Sheet3") * * 'Add column headings * * TargetSheet.Range(Cells(1, 1)).Value = "Disease Group" In other posts I have seen people were helped out by qualifying the cells method with the range, but when I substitute the last line with: * * TargetSheet.Range(TargetSheet.Cells(1, 1)).Value = "Disease Group" it still fails on that line with the same error. Kind regards, John -- Dave Peterson- Hide quoted text - - Show quoted text - Dave, thanks for the prompt reply. Syntax 1 above did the trick. Now on to the next error - I know I'll be back! Kind regards, John |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Run-time error 1004 Method SaveAS of object _Workbook failed | Excel Programming | |||
Run-time error '1004': Method 'Range' of object '_Global' failed | Excel Programming | |||
Run-time error '1004': Method 'Range' of object '_Global' failed | Excel Programming | |||
Run-time error 1004: Method 'Axes' of object '_chart' failed | Excel Programming | |||
"Run-time error '1004'" Method 'Range' of object '_global' failed. | Excel Programming |