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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Named Cells with VBA

Best of Excel

Using Named Cells with VBA

by  dsi  Posted    (Edited  )
Let's say you assigned the name ItemNo to cell B13. To utilize this in VBA you can simply reference the name rather than using the Range method.
Code:
Dim sVal as String

'Get the current value from the cell
sVal = [ItemNo]

'Set the value
[ItemNo] = "Hello"
You can also use different data types, but must make sure that the cell is formatted appropriatly.
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top