LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Numeric Userform Help

Ok, here's the deal. I have 2 macro's currently. the first to call the
user form where the user will input a minimum ammount, maximum ammount,
and the increment in which they want to use. I have the code for the
calculations done, I just need help passing the variables from the
userform to the second macro as numeric values. All of my code is
posted below. Any help would be appreciated.

Thanks in advance.
Andrew

MACRO 1
Public Sub tax()


Dim increment As String
Dim min As Double
Dim max As Double

UserForm1.Show


End Sub


USERFORM

Public Sub IncBox_Change()

increment = IncBox
increment.Value = Val(txtNumber.Text)
End Sub

Public Sub MaxBox_Change()

max = MaxBox
increment.Value = Val(txtNumber.Text)
End Sub

Public Sub MinBox_Change()

min = MinBox
increment.Value = Val(txtNumber.Text)
End Sub

Private Sub OKButton_Click()
UserForm1.Hide
Application.Run ("Calculations")
End Sub

Private Sub UserForm_Click()

End Sub


MACRO 2
Sub Calculations()
'
'

'
Dim rowcounter As Integer

rowcounter = 40

income = min

Do While income <= max

Range("b" & rowcounter).Select
ActiveCell.FormulaR1C1 = income
Selection.Copy
Range("B1").Select
ActiveSheet.Paste
Range("G16").Select
Application.CutCopyMode = False
Selection.Copy
Range("D" & rowcounter).Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=False
Range("G25").Select
Application.CutCopyMode = False
Selection.Copy
Range("C" & rowcounter).Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=False
Range("E" & rowcounter).Select
ActiveCell.FormulaR1C1 = "=RC[-3]-RC[-2]"
Range("F" & rowcounter).Select
ActiveCell.FormulaR1C1 = "=RC[-4]-RC[-2]"

income = income + increment
rowcounter = rowcounter + 1
Loop

End Sub

 
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
Match Single Numeric Criteria and Return Multiple Numeric Labels Sam via OfficeKB.com Excel Worksheet Functions 3 December 30th 05 08:01 PM
Match Single Numeric Criteria and Return Multiple Numeric Labels Sam via OfficeKB.com Excel Worksheet Functions 0 December 29th 05 08:44 PM
check is input textboxes is numeric on userform Jean-Pierre D via OfficeKB.com Excel Programming 7 August 16th 05 08:15 PM
Ensuring UserForm Textbox Entry is numeric [email protected] Excel Programming 3 October 8th 04 11:20 PM
Use numeric data from a textbox on an userform Excel[_3_] Excel Programming 0 July 23rd 03 04:45 PM


All times are GMT +1. The time now is 01:34 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"