Hello, I need some help in creating an user form or input screen in excel so I can input two number manually...my code is as follows:
I need to create some type of input box for specifying range numbers 1) f Range(WS_RANGE).Value > 6465 And Range(WS_RANGE).Value < 6469 Then and 2) If Range(WS_RANGE).Value > 5943 And Range(WS_RANGE).Value < 5946 Then So each input box will have 2 fields for prices and as soon as I input those prices it automatically updates those prices in my code....please advice... Private Sub Worksheet_Calculate() Const WS_RANGE As String = "B1" '<== change to suit CurrentValue = Range(WS_RANGE) On Error GoTo ws_exit Application.EnableEvents = False Application.Undo PriorValue = Range(WS_RANGE) Range(WS_RANGE).Offset(0, -1) = CurrentValue If PriorValue = CurrentValue Then GoTo ws_exit 'cell B1 did not change If Range(WS_RANGE).Value > 6465 And Range(WS_RANGE).Value < 6469 Then Call BuyBeans End If If Range(WS_RANGE).Value > 5943 And Range(WS_RANGE).Value < 5946 Then Call SellBeans End If ws_exit: Application.EnableEvents = True End Sub --~--~---------~--~----~------------~-------~--~----~ ---------------------------------------------------------------------------------- Some important links for excel users: 1. Excel and VBA Tutorials(Video and Text), Free add-ins downloads at http://www.excelitems.com 2. Excel tutorials at http://www.excel-macros.blogspot.com 3. Learn VBA Macros at http://www.vbamacros.blogspot.com 4. Excel Tips and Tricks at http://exceldailytip.blogspot.com To post to this group, send email to excel-macros@googlegroups.com If you find any spam message in the group, please send an email to: Ayush Jain @ jainayus...@gmail.com or Ashish Jain @ 26may.1...@gmail.com <><><><><><><><><><><><><><><><><><><><><><> HELP US GROW !! We reach over 5,000 subscribers worldwide and receive many nice notes about the learning and support from the group. Our goal is to have 10,000 subscribers by the end of 2009. Let friends and co-workers know they can subscribe to group at http://groups.google.com/group/excel-macros/subscribe -~----------~----~----~----~------~----~------~--~---