Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Assign value to named range.

Status
Not open for further replies.

meinhunna

Programmer
Jul 31, 2004
118
AU

I am refering a single cell using named range as follow:
oAmtAdded = [AmountOwing].Value

How can assign a value to the same range?
[AmountOwing].Value = 100 is not working

thanks
 
Did you try to prefix the cell name with its objectname such as ActiveSheet or SheetX or whatever? or to use the extended definition Range("AmountOwing")?

HTH

Luca
 

The use of square brackets that way is kind of a short cut. Each of the following ways works. Take your pick:
Code:
Sub test()
  [AmountOwing] = 100
End Sub
Code:
Sub test2()
  Range("AmountOwing").Value = 200
End Sub
Code:
Sub test3()
  Range("AmountOwing") = 300
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top