ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Dynamic range generator (https://www.excelbanter.com/excel-programming/414976-dynamic-range-generator.html)

Beebolbod

Dynamic range generator
 
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

Jarek Kujawa[_2_]

Dynamic range generator
 
=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

Gary''s Student

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

--
Gary''s Student - gsnu200797


All times are GMT +1. The time now is 02:05 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com