vba: attach a variable name to a selected range

J

Jayne22

I would like to attach a variable name to a range. Is this possible? And if
so, what do I 'Dim' this variable as (string, integer, etc)?

I need to reuse the range when I run a macro which places a formula into a
cell. I want the macro to place a dsum formula into a cell, but since the
range will always be changing, I need to attach a variable to it.

This does not work:

Dim work_items as String
Sheets("work items").Select
work_items = Range("a1:z6000").Value
 

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