LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Bob Phillips
 
Posts: n/a
Default VBA conundrum

It declares a variable, called myVal, of type Long, which means that it can
hold an integer value between -2,147,483,648 and 2,147,483,647. It is this
variabel that I store the user input number.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"csi" wrote in message
...
Thank-you for the info; it was quite useful.
By the way, what does "Dim myVal As Long" do in terms of this macro?
--
vbab


"Bob Phillips" wrote:

Outdoing yourself for helpfulness today, aren't you.

OP,

Here is a little macro that does what I think you ask. It doesn't get

column
C as you predict, so it probably means I don't understand what you need
there.

Dim myVal As Long
Const nDefault As Long = 6000
Const nMin As Long = 20000
Const nMax As Long = 30000

Application.ScreenUpdating = False
myVal = InputBox("Input a number between 0 and 10,000")
If myVal nMin And myVal < nMax Then
If myVal nDefault Then
For i = 1 To myVal \ nDefault
Cells(i, "A").Value = i
Cells(i, "B").Value = nDefault
Cells(i, "C").Value = (nDefault / 1000) * (nDefault /

1000)
* 15
Next i
End If
Cells(i, "A").Value = i
Cells(i, "B").Value = myVal Mod nDefault
Cells(i, "C").Value = (Cells(i, "B").Value / 1000) * _
(Cells(i, "B").Value / 1000) * 15
End If
Application.ScreenUpdating = True

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Jezebel" wrote in message
...

Is it possible to do all these calculations easily?


Yes.











 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calculation Conundrum DonnaS Excel Discussion (Misc queries) 4 September 8th 05 01:14 AM
ISERROR Conundrum forumuser Excel Worksheet Functions 6 August 12th 05 04:07 PM
ISERROR Conundrum forumuser - ExcelForums.com Excel Worksheet Functions 1 August 10th 05 03:49 PM
Pivot Table conundrum Flamikey Excel Discussion (Misc queries) 1 June 8th 05 04:15 PM
Delete Row syntax conundrum username Excel Discussion (Misc queries) 5 May 24th 05 05:36 PM


All times are GMT +1. The time now is 01:33 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"