View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
DavidH[_2_] DavidH[_2_] is offline
external usenet poster
 
Posts: 16
Default how to assign contents of a cell to a macro variable

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