Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Im trying to write a macro in an excel workbook. So far I have the following:
Sub Initialize() €˜Line 1 Dim SelectCell As Range €˜Line 2 Dim clrGold As Integer €˜Line 3 clrGold = Worksheets("Columns").Cells(13, 2).Interior.ColorIndex €˜Line 4 Set SelectCell = Application.InputBox(prompt:="Select a cell", Type:=8) €˜Line 5 Worksheets("Columns").Range(SelectCell).Value = _ Application.InputBox(prompt:="Enter value", Type:=1) €˜Line 6 Worksheets("Columns").Range(SelectCell).Interior.C olorIndex = clrGold €˜Line 7 Worksheets("Rows").Range(SelectCell).Interior.Colo rIndex = clrGold €˜Line 8 Worksheets("Areas").Range(SelectCell).Interior.Col orIndex = clrGold €˜Line 9 End Sub Line 4 sets clrGold to 44. In the InputBox for line 5, I enter B1. In the InputBox for line 6, I enter 5. Line 6 flags an error that says the object doesnt exist. I have tried hard coding the 5 but get the same result. If I comment out line 6, I get the same message on line 7. If I then comment out line 7, I get the same error on line 8. Any ideas? Thanks for the help. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
looking for links that do not exist | Excel Worksheet Functions | |||
Exist or Not. | Excel Discussion (Misc queries) | |||
Object Variable Not Set Error on Selection object | Excel Worksheet Functions | |||
Exist a function to... | Excel Worksheet Functions | |||
Am I Looking For Something That Doesn't Exist? | Excel Discussion (Misc queries) |