Dynamic range generator

  • Thread starter Thread starter Beebolbod
  • Start date Start date
B

Beebolbod

Hi,

I would like to output a pretty simple equation with a couple of characters
in the middle of the answer. So far this wrecks it and i'm guessing the
characters are really performing a function (but i want them not to).

I'd like to output the following to a cell (RTDMA)*32&&-(RTDMA)*32+31 where
RTDMA is a value i enter into a cell elsewhere, which is multiplied by 32
(the product of this is the start of my range) and the same applies to the
2nd RTDMA calc, only it's +31. The ampersands need to denote this is a range.

E.G. RTDMA=1 so using the above and calculating manually i'd have 32&&-63
from and RTDMA of 1.
Hope you follow me and can help.

Rob
 
=D21*32&"&&-"&D21*32+31

presuming RTDMA is in D21

you might also give D21 a name of "RTDMA"

and then use the formula:

=RTDMA*32&"&&-"&RTDMA*32+31

HIH
 
Sub beeb()
Dim s As String, rtdma As Integer
rtdma = 1
s = rtdma * 32 & "@@-" & rtdma * 32 + 31
Cells(1, 1).Value = s
End Sub
 

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

Back
Top