Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: xyxex
  • Order by date
  1. xyxex

    Use a Textbox name in code as a variable

    xyxex (TechnicalUser) 19 Mar 09 7:51 I have a piece of code that checks a value entered in a textbox is numeric. Private Sub txtTargetInc_Change() If HasNumber(txtTargetInc) = True Or txtTargetInc = "" Then GoTo OUT numerror OUT: End Sub I want to re-use this code for all numeric fields by...
  2. xyxex

    Re-using code where only variable is the control

    Have tried your suggestions but I am getting an "object" Required error "424". Appearing here "errchk(txttargetinc)" Private Sub txtTargetInc_Exit(ByVal Cancel As MSForms.ReturnBoolean) ErrChk (txtTargetInc) If txtTargetInc = "" Then GoTo oUT Range("expprem7").Value = Range("expprem").Value *...
  3. xyxex

    Re-using code where only variable is the control

    I have a piece of code that checks a value entered in a textbox is numeric. Private Sub txtTargetInc_Change() If HasNumber(txtTargetInc) = True Or txtTargetInc = "" Then GoTo OUT numerror OUT: End Sub I want to re-use this code for all numeric fields by bringing the control name into the...
  4. xyxex

    Named ranges in VBA

    The Control is a textbox. each one is named "txtrate" + number eg ""txtrate2" They are on a userform named "ufCovedet" They are populated by referencing a shreadheet name "data" with Range named "rate" + number "a" eg "rate2a" I want to populate via a loop "txtRate2" from data held in Range...
  5. xyxex

    Named ranges in VBA

    Any Suggestions? re Control object.
  6. xyxex

    Named ranges in VBA

    The problem seems to stem from VBA's requirement that named ranges must be referred to in quotes(""). I am guessing it is something to do with "DIM as" If I Dim as Range newtext2 retuns as =0, if i Dim as String newtext2 returns as "data!rate2a" but Range wont accept as valid. FYI...
  7. xyxex

    Named ranges in VBA

    yes but sheet is called data
  8. xyxex

    Named ranges in VBA

    I am trying to write a loop that will populate a group of named worksheet cells. my code is Private Sub Rate_Change() 'update rates when one is changed Dim i, Text As String, newtext As String, Text2 As String, NewText2 As String, h Text = "txtrate" Text2 = "data!rate"...
  9. xyxex

    Viarables as object names

    Worked a treat! Thanks
  10. xyxex

    Viarables as object names

    I have a number of textboxes on a user for that I need to perform the same action on. I am trying to write a loop that will take a common part of the name and add a numbe to the end. This new text then becomes the textbox name Private Sub Loop1() Dim Coretext, Newtext Coretext = "Textbox" For i...

Part and Inventory Search

Back
Top