Question about named area

O

Orlando

HI, I have created several named areas in an Excel SpreadSheet, my cuestion
is, in VBA programming how can I make reference to these diferent areas in a
dinamic way.

Let say I have a worksheet whith several concepts repeated several times,
each concept is a named area. example

Salary 1500
Groceries 200
movies 30
Groceries 50

my question is how can I in VBA read Salary and add 1500 to the named area
Salary, and after Groceries, movies, etc.

If somebody can help me I would appreciated.

Thanks
 
T

Tom Ogilvy

set r = cells(rows.count,1).End(xlup)(2)
r.value = "Groceries"
r.offset(0,1).Value = 1500

or another interpretation:

set r = cells(rows.count,1).End(xlup)(2)
r.value = "Groceries"
r.offset(0,1).Value = application.sumif(Range(Cells(1,1), _
rng),"Groceries",Range(cells(1,1),rng).offset(0,1)) + 1500
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top