Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Range - setting a value in a cell
what am i doing wrong
dim myRange as Range dim iNum as integer iNum= 6 Set myRange = Cells(iNum + 2, 1) myRange.Value = 34 trying to set a cell myRange to cell(8,1) then putting the value 34 into the cell |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Range - setting a value in a cell
iNum= 6
Set myRange = Cells(iNum + 2, 1) myRange.Value = 34 The above placed in the immediate window (with sheet1 active) places 34 in cell A8 To extend this out into a full macro you need to put it in a standard module with a name like: Sub Foo() dim myRange as Range dim iNum as integer iNum= 6 Set myRange = Cells(iNum + 2, 1) myRange.Value = 34 End Sub Then just Run Foo,,, HTH "cantonarv" wrote in message oups.com... what am i doing wrong dim myRange as Range dim iNum as integer iNum= 6 Set myRange = Cells(iNum + 2, 1) myRange.Value = 34 trying to set a cell myRange to cell(8,1) then putting the value 34 into the cell |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel Addin:Setting the range to the Excel.Range object range prop | Excel Worksheet Functions | |||
setting range().hidden=True causes range error 1004 | Excel Programming | |||
changing the currenc setting of a cell or range | Excel Programming | |||
Setting a range with the last used cell? | Excel Programming | |||
Setting a range value to the last cell in active worksheet. | Excel Programming |