Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I'm trying to set the contents of cell A6 in the "General Documentation" worksheet of the active workbook to a variable. First I test for the General Documentation worksheet, and that part of my code works. Here's the next part: Dim CellDesc As String CellDesc = ActiveWorkbook.Sheets("General Documentation").Cells(a6).Value I get error 1004, application defined or object defined error. Should I be using something else besides string? Does it make a difference if the cell value is a string or a number? Thanks for the help! David |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
either:
CellDesc = ActiveWorkbook.Sheets("General Documentation").Cells("a6").Value (Notice the "A6" change.) or CellDesc = ActiveWorkbook.Sheets("General Documentation").Cells(6,"A").Value DavidH wrote: Hi, I'm trying to set the contents of cell A6 in the "General Documentation" worksheet of the active workbook to a variable. First I test for the General Documentation worksheet, and that part of my code works. Here's the next part: Dim CellDesc As String CellDesc = ActiveWorkbook.Sheets("General Documentation").Cells(a6).Value I get error 1004, application defined or object defined error. Should I be using something else besides string? Does it make a difference if the cell value is a string or a number? Thanks for the help! David -- Dave Peterson |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
David,
Try: CellDesc = ActiveWorkbook.Sheets("General Documentation").Range("A6").Value -- Hope that helps. Vergel Adriano "DavidH" wrote: Hi, I'm trying to set the contents of cell A6 in the "General Documentation" worksheet of the active workbook to a variable. First I test for the General Documentation worksheet, and that part of my code works. Here's the next part: Dim CellDesc As String CellDesc = ActiveWorkbook.Sheets("General Documentation").Cells(a6).Value I get error 1004, application defined or object defined error. Should I be using something else besides string? Does it make a difference if the cell value is a string or a number? Thanks for the help! David |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Vergel, it worked perfectly!
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
assign next serial number based on contents of another cell | New Users to Excel | |||
Assign cell value to variable | Excel Programming | |||
How can I assign a range starting cell based on a variable locati. | Excel Discussion (Misc queries) | |||
Change cell formula & assign to VBA variable... | Excel Programming | |||
Assign relative cell reference to variable | Excel Programming |