Checking values in the column with IF statement and copy it to another sheet

  • Hello to all,

    I am working on a project that you have measurement results on the sheets and on the main sheet you can see these results with combobox selection.

    I tried to do something but I have compile error 1004 message


    Edited once, last by Carim: Added Code Tags ().

  • Hello,


    If you are getting a compile error 1004 message at the line #10 ...


    it probably means the worksheet name added in the TextBox1 does not match a worksheet name in your file ...


    Hope this will help

    :)

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Thumbs Up" icon, below, in the bottom right corner:)

  • I think the variable wb1 has defined as the user select the sheet from the combobox.


    Agree with you ... but the question remains ... what are the choices presented in the combobox ...???

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Thumbs Up" icon, below, in the bottom right corner:)

  • This is the project excel.


    My goal is this,


    Get the values (A19:A41) from the selected sheet which is in the Combobox on Sheet1.

    and check that if

    * it is < 999 then paste the cell value to Sheet1 K9 and paste "Hz" to Sheet1 L9.

    *it is > 999 then divide the cell value by 1000 and paste it to Sheet1 K9 and write "kHz" to Sheet1 L9.


    and this will be applied to all rows between (A19:A41).

    Files

    • Book1.xlsm

      (36.53 kB, downloaded 64 times, last: )
  • Thanks for your file :)


    It does make things much much easier ...!!!


    As soon as I have a moment, will look for a solution ...;)

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Thumbs Up" icon, below, in the bottom right corner:)

  • Hello again,


    You could test following modification


    Hope this will help

    :)

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Thumbs Up" icon, below, in the bottom right corner:)