Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Why doesn't this code work?:
Sub test1() Dim ws1 As Worksheet Dim ws2 As Worksheet Dim rng1 As Range Dim rng2 As Range Sheets("Sheet2").Activate Set ws2 = Worksheets("Sheet2") Set ws1 = Worksheets("Sheet1") Set rng1 = ws1.Range(Cells(3, 1), Cells(7, 1)) Set rng2 = ws2.Range(Cells(5, 5), Cells(5, 5)) When it gets to the "Set rng2 ..." line it give a "Runtime error '1004' ...." It seems strange that it works for the "Set rng1" line without problem. Also, I can't seem to find a good reference that will help me learn the idiosyncracies of setting/naming ranges, worksheets, and workbooks. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
converting email address names in a range of cells to real names | Excel Worksheet Functions | |||
Setting Tab Names To Dates In Spreadsheet | Excel Worksheet Functions | |||
Setting Tab Names To Dates In Spreadsheet | Excel Worksheet Functions | |||
Setting file names | Excel Programming | |||
Setting variable names in code | Excel Programming |