+ Reply to Thread
Results 1 to 19 of 19

Need help TextBox stuck

  1. #1
    Registered User
    Join Date
    10-12-2011
    Location
    Malaysia
    MS-Off Ver
    Excel 2016
    Posts
    94

    Need help TextBox stuck

    Hi Guys, I need your expertise to solve on this issue. From code below, the textBox will stuck after find the duplicate no. Any help will appreciate.
    Please Login or Register  to view this content.
    Thank you
    Dean

  2. #2
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Need help TextBox stuck

    I think its cause you are changing again. Can you attach the sheet?
    Hope this helps

    Sometimes its best to start at the beginning and learn VBA & Excel.

    Please dont ask me to do your work for you, I learnt from Reading books, Recording, F1 and Google and like having all of this knowledge in my head for the next time i wish to do it, or wish to tweak it.
    Available for remote consultancy work PM me

  3. #3
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Need help TextBox stuck

    You must reset blnRun before you exit sub:
    Please Login or Register  to view this content.
    • Please remember to mark threads Solved with Thread Tools link at top of page.
    • Please use code tags when posting code: [code]Place your code here[/code]
    • Please read Forum Rules

  4. #4
    Registered User
    Join Date
    10-12-2011
    Location
    Malaysia
    MS-Off Ver
    Excel 2016
    Posts
    94

    Re: Need help TextBox stuck

    Hi Izandol, yes you are right. Thank you very much.

    Hi Nathansav, yes I add some macros at different UF. Still learning in progress.....

  5. #5
    Registered User
    Join Date
    10-12-2011
    Location
    Malaysia
    MS-Off Ver
    Excel 2016
    Posts
    94

    Re: Need help TextBox stuck

    Hi Guys, I having problem again with the textbox. Now when I testing using card reader the textbox only appear 11 digit instead of 12. But the digit input at cell is correct 12 digit? This cause my label unable to capture the values. Any idea?

    *I do not know whether need to open new thread or continue with this current.

  6. #6
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Need help TextBox stuck

    Is your maximum length set on the box? Also, i meant when you put "" into the text box, you are changing the text box again, so it gets stuck

  7. #7
    Registered User
    Join Date
    10-12-2011
    Location
    Malaysia
    MS-Off Ver
    Excel 2016
    Posts
    94

    Re: Need help TextBox stuck

    Hi nathasav, I don't get it. The max lenght is set 0 for the textbox & the "" thing. Can you please explain more?

  8. #8
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: Need help TextBox stuck

    Are you sure there isn't a 12th character?

    Perhaps a linefeed or some other non-printing character.
    If posting code please use code tags, see here.

  9. #9
    Registered User
    Join Date
    10-12-2011
    Location
    Malaysia
    MS-Off Ver
    Excel 2016
    Posts
    94

    Re: Need help TextBox stuck

    Hi Norie, I've attached the file. If I manually key in the number into textbox, it worked! But if use card reader the number appear only 11 digit. But at cell it show 12 digit?

    tq.
    Attached Files Attached Files

  10. #10
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Need help TextBox stuck

    My post "I think its cause you are changing again. Can you attach the sheet? " meant you are triggering the change event of the text box again by putting "" into it.

  11. #11
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Need help TextBox stuck

    I used 123456789111 and it was ok.

  12. #12
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: Need help TextBox stuck

    Are you sure the card reader isn't adding an extra non-printing character?

    What do you see if you add the message box below this to the code?
    Please Login or Register  to view this content.
    Last edited by Norie; 08-27-2014 at 02:42 PM.

  13. #13
    Registered User
    Join Date
    11-17-2012
    Location
    Bangalore
    MS-Off Ver
    Excel 2010
    Posts
    38

    Question Excel search and find unique values

    Dear Team,

    I would like to extend the below code

    Here i have 2 sheets(1. Editable Pipeline data 2. Trace inputs ) so here i want to compare my Editable Pipeline data with Trace inputs and fetch new data values and update it Editable Pipeline data sheet.

    2nd step is do the vlookup from the Editable data to Trace inputs and fetch the other related info


    below is the code , here i am getting error becoz i am extending values the data whereas the macros i am not able to extend it

    sample excel sheet also attached please help


    please helpSub Macro8() ' ' Macro8 Macro ' Myworkings '

    ' Sheets("Trace Inputs").Select Range("A1").Select Range(Selection, Selection.End(xlDown)).Select Selection.Copy Selection.End(xlUp).Select Selection.End(xlToRight).Select Range("AR1").Select ActiveSheet.Paste Selection.End(xlToLeft).Select Application.CutCopyMode = False Sheets("Editable Pipeline data").Select Range("B15").Select Range(Selection, Selection.End(xlDown)).Select Selection.Copy Sheets("Workings").Select Range("A2").Select ActiveSheet.Paste Range("B2").Select Application.CutCopyMode = False ActiveCell.FormulaR1C1 = "Masterdata" Range("B2").Select Selection.Copy Range("A2").Select Selection.End(xlDown).Select Range("B177").Select Range(Selection, Selection.End(xlUp)).Select ActiveSheet.Paste Selection.End(xlUp).Select Range("B1").Select Application.CutCopyMode = False ActiveCell.FormulaR1C1 = "Data" Range("B2").Select Sheets("Trace Inputs").Select Range("F2").Select Range(Selection, Selection.End(xlDown)).Select Selection.Copy Sheets("Workings").Select Range("A2").Select Selection.End(xlDown).Select Range("A178").Select ActiveSheet.Paste Range("B178").Select Application.CutCopyMode = False ActiveCell.FormulaR1C1 = "Present Pipeline" Range("B178").Select Selection.Copy Range("A178").Select Selection.End(xlDown).Select Range("B384").Select Range(Selection, Selection.End(xlUp)).Select ActiveSheet.Paste Selection.End(xlUp).Select Application.CutCopyMode = False Selection.AutoFilter Columns("A:A").Select Selection.FormatConditions.AddUniqueValues Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority Selection.FormatConditions(1).DupeUnique = xlDuplicate With Selection.FormatConditions(1).Font .Color = -16383844 .TintAndShade = 0 End With With Selection.FormatConditions(1).Interior .PatternColorIndex = xlAutomatic .Color = 13551615 .TintAndShade = 0 End With Selection.FormatConditions(1).StopIfTrue = False ActiveSheet.Range("$A$1:$B$384").AutoFilter Field:=2, Criteria1:= _ "Present Pipeline" ActiveSheet.Range("$A$1:$B$384").AutoFilter Field:=1, Criteria1:=RGB(255, _ 255, 255), Operator:=xlFilterCellColor Range("A244").Select Range(Selection, Selection.End(xlDown)).Select Selection.Copy Sheets("Editable Pipeline data").Select Selection.End(xlUp).Select Range("B15").Select Selection.End(xlDown).Select Range("B191").Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Range("C189").Select Sheets("Workings").Select Range("A1").Select Application.CutCopyMode = False Selection.AutoFilter Columns("A:B").Select Selection.Delete Shift:=xlToLeft Sheets("Editable Pipeline data").Select Range("B190").Select Selection.End(xlUp).Select Range("B15").Select Selection.End(xlDown).Select Range("B190").Select Selection.End(xlUp).Select Range("C15").Select Selection.End(xlDown).Select Range("C191").Select ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-1],'Trace Inputs'!R2C6:R208C15,10,0)" Range("C191").Select Sheets("Trace Inputs").Select Range("F195").Select Selection.End(xlUp).Select Range("AR1").Select Sheets("Editable Pipeline data").Select ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-1],'Trace Inputs'!R2C6:R208C44,10,0)" Range("D191").Select ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-2],'Trace Inputs'!R2C6:R208C44,11,0)" Range("C191:D191").Select Selection.Cut Range("E191").Select ActiveSheet.Paste Range("F191").Select ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-4],'Trace Inputs'!R2C6:R208C44,14,0)" Range("F191").Select ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-4],'Trace Inputs'!R2C6:R208C44,13,0)" Range("F191").Select ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-4],'Trace Inputs'!R2C6:R208C44,12,0)" Range("G191").Select ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-5],'Trace Inputs'!R2C6:R208C44,13,0)" Range("H191").Select ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-6],'Trace Inputs'!R2C6:R208C44,14,0)" Range("I191").Select Sheets("Trace Inputs").Select Range("AF1").Select Selection.End(xlToLeft).Select Range("F1:AG1").Select Sheets("Editable Pipeline data").Select ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-7],'Trace Inputs'!R2C6:R208C44,19,0)" Range("J191").Select ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-8],'Trace Inputs'!R2C6:R208C44,28,0)" Range("K191").Select Sheets("Trace Inputs").Select Range("F1:AI1").Select Range(Selection, Selection.End(xlToRight)).Select Sheets("Editable Pipeline data").Select ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-9],'Trace Inputs'!R2C6:R208C44,30,0)" Range("Q191").Select Selection.End(xlToLeft).Select Selection.End(xlToLeft).Select Selection.End(xlToLeft).Select Selection.End(xlToLeft).Select Selection.End(xlToLeft).Select Selection.End(xlToLeft).Select Selection.End(xlToLeft).Select Selection.End(xlToLeft).Select Selection.End(xlToLeft).Select Selection.End(xlToLeft).Select Selection.End(xlToLeft).Select ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[1],'Trace Inputs'!R2C6:R208C44,39,0)" Range("A191").Select Sheets("Trace Inputs").Select Range("AE1").Select Selection.End(xlToLeft).Select Range("F1:AF1").Select Sheets("Editable Pipeline data").Select Range("Q191").Select ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-15],'Trace Inputs'!R2C6:R208C44,27,0)" Range("A191").Select Selection.Copy Range("A192").Select ActiveSheet.Paste Range("E191:Q191").Select Application.CutCopyMode = False Selection.Copy Range("E192").Select ActiveSheet.Paste Application.CutCopyMode = False ActiveWorkbook.Save Range("D187").Select Selection.End(xlUp).Select Range("D15").Select Selection.End(xlDown).Select Range("D191").Select End Sub
    Attached Files Attached Files

  14. #14
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: Need help TextBox stuck

    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.

  15. #15
    Registered User
    Join Date
    10-12-2011
    Location
    Malaysia
    MS-Off Ver
    Excel 2016
    Posts
    94

    Re: Need help TextBox stuck

    Hi Norie, the message showed 48. What is the meaning?

    Hi nathasav, yes if key in manually no problem. But if swipe use the card reader it only show 11digit. At cell show value 12 digit.

    Thank you
    Dean

  16. #16
    Registered User
    Join Date
    10-12-2011
    Location
    Malaysia
    MS-Off Ver
    Excel 2016
    Posts
    94

    Re: Need help TextBox stuck

    Guys, when I disable below code, the textbox able to capture all 12 digit. Please advice what when wrong?
    Please Login or Register  to view this content.
    tq.

  17. #17
    Registered User
    Join Date
    10-12-2011
    Location
    Malaysia
    MS-Off Ver
    Excel 2016
    Posts
    94

    Re: Need help TextBox stuck

    Hi Guys, Forget to mention that have some problem with set focus as well. It only happened for the first swipe only everytime run the program.

  18. #18
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Need help TextBox stuck

    Is your 12th digit VBCRLF? ive used scanners before and it sent a carriage return at the end, for when scanning to get product info etc.

  19. #19
    Registered User
    Join Date
    10-12-2011
    Location
    Malaysia
    MS-Off Ver
    Excel 2016
    Posts
    94

    Re: Need help TextBox stuck

    Hi nathansav, it just 1 line. Weird.. after amend the textbox maxlenght to 12 now working. Only the set focus will stuck for 1st time swipe only. After that all run well. Any idea/suggestion?

    tq
    Dean

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Stuck at work and stuck on a count function
    By gregfetzer in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-24-2012, 12:47 AM
  2. Replies: 3
    Last Post: 05-07-2012, 09:46 PM
  3. really stuck with auto updating a textbox on opening a workbook
    By markus_87 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-01-2011, 10:06 AM
  4. Userform Textbox updating a another userform textbox (im stuck!!)
    By wapwap in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-31-2011, 02:56 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1