Results 1 to 5 of 5

Thread: Create Invoice From Flat Data Range

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Administrator Excel Fox's Avatar
    Join Date
    Mar 2011
    Posts
    1,401
    Rep Power
    10
    johnreid, can you clarify exactly what you want to achieve? The example you mentioned above is not there in the attachment. The output example you've posted above can be made, but you have to share exactly how does the input cells contain the value. I don't think the attachment you have here adds any value to what you are purposing to do.
    A dream is not something you see when you are asleep, but something you strive for when you are awake.

    It's usually a bad idea to say that something can't be done.

    The difference between dream and aim, is that one requires soundless sleep to see and the other requires sleepless efforts to achieve

    Join us at Facebook

  2. #2
    Junior Member
    Join Date
    May 2013
    Posts
    6
    Rep Power
    0
    Quote Originally Posted by Excel Fox View Post
    johnreid, can you clarify exactly what you want to achieve? The example you mentioned above is not there in the attachment. The output example you've posted above can be made, but you have to share exactly how does the input cells contain the value. I don't think the attachment you have here adds any value to what you are purposing to do.
    Hi Excelfox,

    Ignore my first post sorry if make confuse, i give step by step to tell my problem excel.

    Code:
        Private Sub buttonnew_Click()
        Dim RowCount As Long
        Dim benefits, total As Single
        
    
        RowCount = Worksheets("Data").Range("B1").CurrentRegion.Rows.Count    ' i think it's code wrong only read row
        With Worksheets("Data").Range("B1")
            .Offset(RowCount, 0) = Me.noinvoice.Value    'input in row B column 2
            .Offset(RowCount, 1) = Me.Tanggal.Value      'input in row C column 2
            .Offset(RowCount, 2) = Me.Costumers.Value    'input in row D column 2
            .Offset(RowCount, 20) = Me.Note.Value        'input in row V column 2
            .Offset(RowCount, 22) = Me.ttd.Value         'input in row X column 2
            .Offset(RowCount, 21) = Me.initial.Value     'input in row W column 2
            
            .Offset(RowCount, 10) = Me.item1.Value    'input in row L column 2
            .Offset(RowCount, 10) = Me.item2.Value    'input in row L column 3
            .Offset(RowCount, 10) = Me.item3.Value    'input in row L column 4
            .Offset(RowCount, 10) = Me.item4.Value    'input in row L column 5
            .Offset(RowCount, 10) = Me.item5.Value    'input in row L column 6
            .Offset(RowCount, 10) = Me.item6.Value    'input in row L column 7
            .Offset(RowCount, 10) = Me.item7.Value    'input in row L column 8
            .Offset(RowCount, 10) = Me.item8.Value    'input in row L column 9
            .Offset(RowCount, 10) = Me.item9.Value    'input in row L column 10
            .Offset(RowCount, 10) = Me.item10.Value   'input in row L column 11
            .Offset(RowCount, 9) = Me.type1.Value    'input in row K column 2
            .Offset(RowCount, 9) = Me.type2.Value    'input in row K column 3
            .Offset(RowCount, 9) = Me.type3.Value    'input in row K column 4
            .Offset(RowCount, 9) = Me.type4.Value    'input in row K column 5
            .Offset(RowCount, 9) = Me.type5.Value    'input in row K column 6
            .Offset(RowCount, 9) = Me.type6.Value    'input in row K column 7
            .Offset(RowCount, 9) = Me.type7.Value    'input in row K column 8
            .Offset(RowCount, 9) = Me.type8.Value    'input in row K column 9
            .Offset(RowCount, 9) = Me.type9.Value    'input in row K column 10
            .Offset(RowCount, 9) = Me.type10.Value   'input in row K column 11
            .Offset(RowCount, 11) = Me.harga1.Value    'input in row M column 2
            .Offset(RowCount, 11) = Me.harga2.Value    'input in row M column 3
            .Offset(RowCount, 11) = Me.harga3.Value    'input in row M column 4
            .Offset(RowCount, 11) = Me.harga4.Value    'input in row M column 5
            .Offset(RowCount, 11) = Me.harga5.Value    'input in row M column 6
            .Offset(RowCount, 11) = Me.harga6.Value    'input in row M column 7
            .Offset(RowCount, 11) = Me.harga7.Value    'input in row M column 8
            .Offset(RowCount, 11) = Me.harga8.Value    'input in row M column 9
            .Offset(RowCount, 11) = Me.harga9.Value    'input in row M column 10
            .Offset(RowCount, 11) = Me.harga10.Value   'input in row M column 11
            .Offset(RowCount, 12) = Me.unit1.Value   'input in row N column 2
            .Offset(RowCount, 12) = Me.unit2.Value   'input in row N column 3
            .Offset(RowCount, 12) = Me.unit3.Value   'input in row N column 4
            .Offset(RowCount, 12) = Me.unit4.Value   'input in row N column 5
            .Offset(RowCount, 12) = Me.unit5.Value   'input in row N column 6
            .Offset(RowCount, 12) = Me.unit6.Value   'input in row N column 7
            .Offset(RowCount, 12) = Me.unit7.Value   'input in row N column 8
            .Offset(RowCount, 12) = Me.unit8.Value   'input in row N column 9
            .Offset(RowCount, 12) = Me.unit9.Value   'input in row N column 10
            .Offset(RowCount, 12) = Me.unit10.Value  'input in row N column 11
            .Offset(RowCount, 14) = Me.disc1.Value   'input in row P column 2
            .Offset(RowCount, 14) = Me.disc2.Value   'input in row P column 3
            .Offset(RowCount, 14) = Me.disc3.Value   'input in row P column 4
            .Offset(RowCount, 14) = Me.disc4.Value   'input in row P column 5
            .Offset(RowCount, 14) = Me.disc5.Value   'input in row P column 6
            .Offset(RowCount, 14) = Me.disc6.Value   'input in row P column 7
            .Offset(RowCount, 14) = Me.disc7.Value   'input in row P column 8
            .Offset(RowCount, 14) = Me.disc8.Value   'input in row P column 9
            .Offset(RowCount, 14) = Me.disc9.Value   'input in row P column 10
            .Offset(RowCount, 14) = Me.disc10.Value  'input in row P column 11
        End With
    
        End Sub
    Explain :
    'My Goal : If i'm create one invoice, my value (item, type, unit, harga until 10 column) do it complete in my sheet "Data".
    'My Problem : My VBA code in upper just copy paste from basic VBA only for row single column, need fix and need opinion (in case i don't understand about offset value)
    'Reward : I'm just have $10 paypal please help us.

    'My Tutorial in below :

    1. Example i do my job in userform like this.


    2. Result Sheet "Data" become like this.


    3. If i do next invoice example 0002/SM/06/13 and same description (item, type, unit, harga until 10 column) will do it in Column 2 and my first invoice 0001/SM/06/13 auto down.



    Thanks - John
    Attached Files Attached Files

Similar Threads

  1. Replies: 5
    Last Post: 12-05-2012, 03:01 AM
  2. Replies: 10
    Last Post: 11-27-2012, 08:27 PM
  3. Combining data of Two Array or Range
    By princ_wns in forum Excel Help
    Replies: 5
    Last Post: 10-01-2012, 06:52 PM
  4. Replies: 0
    Last Post: 09-07-2012, 09:10 PM
  5. Excel Macro to Sort Data if a value changes in defined range
    By Rajesh Kr Joshi in forum Excel Help
    Replies: 4
    Last Post: 09-05-2012, 10:31 AM

Posting Permissions

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