+ Reply to Thread
Results 1 to 2 of 2

Userform Question

  1. #1
    Registered User
    Join Date
    12-03-2018
    Location
    Sweden
    MS-Off Ver
    2010
    Posts
    1

    Userform Question

    Hi,

    I have this problem, i have a userform where u can chose diffrent kind of hardware equipment, when selected it goes to one sheet, after that i want it to go to another sheet and in a specific row give me number "1"
    See my code so far:

    In code below the numer "1" goes direct to assigend cell : Blad2.Range("M98") ( but i want the number to go to the same row as a specific criteria.

    The criteria is in column A (it is the distributers order number) i want excel to find that and but my numer in column M on the same row.

    Thanks for your help


    Private Sub CommandButton1_Click()




    'For listbox to worksheet

    Dim r As Long





    For r = 1 To Me.lbxHW.ListCount - 1

    If Me.lbxHW.Selected(r) Then

    Blad28.Range("A" & Rows.count).End(xlUp).Offset(1, 0) = Me.lbxHW.List(r, 0)



    For i = 2 To 20


    If Blad28.Cells(i, 1) = "HP 700 Printer & Inks" Then

    Blad2.Range("M98") = Application.WorksheetFunction.CountIf(Blad28.Range("A:A"), "HP 700 Printer & Inks")
    Blad2.Range("M737") = Application.WorksheetFunction.CountIf(Blad28.Range("A:A"), "HP 700 Printer & Inks")
    Blad2.Range("M739") = Application.WorksheetFunction.CountIf(Blad28.Range("A:A"), "HP 700 Printer & Inks")
    Blad2.Range("M740") = Application.WorksheetFunction.CountIf(Blad28.Range("A:A"), "HP 700 Printer & Inks")
    Blad2.Range("M741") = Application.WorksheetFunction.CountIf(Blad28.Range("A:A"), "HP 700 Printer & Inks")
    Blad2.Range("M742") = Application.WorksheetFunction.CountIf(Blad28.Range("A:A"), "HP 700 Printer & Inks")
    Blad2.Range("M743") = Application.WorksheetFunction.CountIf(Blad28.Range("A:A"), "HP 700 Printer & Inks")
    Last edited by codechris; 09-08-2021 at 04:43 AM.

  2. #2
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,304

    Re: Userform Question

    see big yellow banner - upload your workbook - after you have put your code between code tags.
    Torachan,

    Mission statement; Promote the use of Tables, Outlaw the use of 'merged cells' and 'RowSource'.

+ 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. UserForm Question
    By wonderd in forum Excel General
    Replies: 13
    Last Post: 06-23-2014, 08:35 AM
  2. [SOLVED] Quick question Userform to userform
    By Excelnoub in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-16-2013, 03:03 PM
  3. Userform question
    By grey_fox33 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-17-2011, 01:20 AM
  4. [SOLVED] userform question
    By Gary Keramidas in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-31-2006, 04:10 AM
  5. userform question
    By Gary Keramidas in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-09-2005, 11:00 AM
  6. Userform Question
    By Ray Batig in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-23-2005, 08:06 PM
  7. [SOLVED] UserForm Question:Is it possible to save and close a file via a userform.
    By jer in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-13-2005, 08:06 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