ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Cell generation from user input question. (https://www.excelbanter.com/excel-programming/350659-cell-generation-user-input-question.html)

Thundersixx

Cell generation from user input question.
 

I don't know if this is the right forum to be using, however I have a
question. I've never done any programming in Excel before but willing
to learn if you can point me in the right direction.This might be a
simple question that you can help me with right away. Here we go:

If a user inputs a Min and Max value, say 1000 & 10000. I would like a
column in another sheet to produce cells from 1000 to 10000 in
increments of 1000 (or if possible for large ranges, in increments of
10% of the max)


--
Thundersixx
------------------------------------------------------------------------
Thundersixx's Profile: http://www.excelforum.com/member.php...o&userid=30556
View this thread: http://www.excelforum.com/showthread...hreadid=502093


Tom Ogilvy

Cell generation from user input question.
 
Dim lbound as Long, ubound as Long, inc as Long
Dim i as Long, j as Long
lbound = range("A1").value
ubound = range("A2").Value
inc = Application.Round((ubound - lbound + 1)*.10,0)
if inc < 1000 then
inc = 1000
End if
j = 1
for i = lbound to ubound step inc
Worksheets("Sheet2").Cells(j,1) = i
j = j + 1
Next

there are certainly faster ways to get the data into excel, but this should
be a start.
--
Regards,
Tom Ogilvy


"Thundersixx"
wrote in message
...

I don't know if this is the right forum to be using, however I have a
question. I've never done any programming in Excel before but willing
to learn if you can point me in the right direction.This might be a
simple question that you can help me with right away. Here we go:

If a user inputs a Min and Max value, say 1000 & 10000. I would like a
column in another sheet to produce cells from 1000 to 10000 in
increments of 1000 (or if possible for large ranges, in increments of
10% of the max)


--
Thundersixx
------------------------------------------------------------------------
Thundersixx's Profile:

http://www.excelforum.com/member.php...o&userid=30556
View this thread: http://www.excelforum.com/showthread...hreadid=502093





All times are GMT +1. The time now is 08:24 AM.

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