Posts by jaslake

    Re: Populate listbox with filtered range


    This requires With...End With

    Code
    Set rng = .Range("A1:A" & LR).SpecialCells(xlCellTypeVisible)


    This does not

    Code
    Set rng = Sheets("Sheet1") .Range("A1:A" & LR).SpecialCells(xlCellTypeVisible)

    Re: Populate listbox with filtered range


    Hi ignasis


    Count 'em...10 items (0 through 9)


    Code
    (0) .AddItem CStr(Cel1.Value)
      (1) .List(.ListCount - 1, 1) = Cel1.Offset(0, 1).Value
      (2) .List(.ListCount - 1, 2) = Cel1.Offset(0, 2).Value
      (3) .List(.ListCount - 1, 3) = Cel1.Offset(0, 3).Value
      (4) .List(.ListCount - 1, 4) = Cel1.Offset(0, 4).Value
      (5) .List(.ListCount - 1, 5) = Cel1.Offset(0, 5).Value
      (6) .List(.ListCount - 1, 6) = Cel1.Offset(0, 6).Value
      (7) .List(.ListCount - 1, 7) = Cel1.Offset(0, 7).Value
      (8) .List(.ListCount - 1, 8) = Cel1.Offset(0, 8).Value
      (9) .List(.ListCount - 1, 9) = Cel1.Offset(0, 9).Value


    Yes, it's a Range Object.

    Quote

    And just to make sure, cel1 should be declared as range?

    Re: Populate listbox with filtered range


    Hi ignasis


    The Dot (.) before Range is used in the With...End With construct like so...


    Quote

    why If you have 10 columns, listcount is only 9


    List Count is 0 based unless you tell the Code differently; so, 0 to 9 will be 10 (in your case 0 to 7 will be 8...Columns A - H).

    Quote

    why is it working without declare "cel1"?


    Because you've not used Option Explicit which forces one to declare all Variables.

    Re: Populate listbox with filtered range


    Hi ignasis


    Here's some code I have in my toolbox. See if you can adapt it.


    Re: consolidate lot details


    Hi gentle_20052006


    Attached is a partial solution. As you'll see I have an issue that I've not yet resolved.


    Developing a relationship among the three sheets (Consolidated Invoice, Lot Wise Invoice and Output) is key to a solution...Princess Bride "He's only mostly dead"...well, I've mostly done that...not quite.


    Try it...CTRL + z will fire the Code.



    [ATTACH=CONFIG]68683[/ATTACH]


    Re: VBA - Copy Data From A Worksheet and Paste In New Row In Different Worksheet


    Hi Roy


    Try this Code in a general Module...

    Re: OBLIGATION to choose a control


    Hi MADA BLACK


    Perhaps something like this...

    Re: vba to find data in two different sheets


    Hi Raj g


    Try this Code...