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,402
    Rep Power
    10
    Missed this one john reid, can you confirm if you are still looking for a solution.
    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
    Missed this one john reid, can you confirm if you are still looking for a solution.
    Thanks all solved

    Private Sub buttonclose_Click()
    Unload Me
    End Sub


    Private Sub buttonnew_Click()
    Dim Cancel As Boolean
    Dim keyCol As Range
    Dim i As Long
    Set keyCol = ThisWorkbook.Sheets("Data").Columns(2)


    If Me.noinvoice.Value = "" Then
    MsgBox "Please enter a name", vbExclamation, "Invoice"
    Cancel = True
    End If
    If Me.Tanggal.Value = "" Then
    MsgBox "Please enter a item", vbExclamation, "Invoice"
    Cancel = True
    End If
    If Me.Costumers1.Value = "" Then
    MsgBox "Please enter a costumers name", vbExclamation, "Invoice"
    Cancel = True
    End If
    If Me.ttd.Value = "" Then
    MsgBox "Please enter a ttd", vbExclamation, "Invoice"
    Cancel = True
    End If
    If Me.initial.Value = "" Then
    MsgBox "Please enter a initial", vbExclamation, "Invoice"
    Cancel = True
    End If

    If Cancel = True Then
    'Do nothing
    Else

    For i = 1 To 10
    If Me.Controls("item" & i).Text <> vbNullString Then
    With keyCol.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).EntireRow
    .Columns("M").Value = Me.Controls("item" & i).Text
    .Columns("O").Value = Me.Controls("unit" & i).Value
    .Columns("L").Value = Me.Controls("type" & i).Text
    .Columns("N").Value = Me.Controls("harga" & i).Value
    .Columns("Q").Value = disc1.Value / 100
    .Columns("Z").Value = Me.PajakCode.Value
    .Columns("T") = "10%"
    .Columns("B") = noinvoice
    .Columns("C").Value = Me.Tanggal.Value
    .Columns("D").Value = Costumers1.Value
    .Columns("W").Value = Note
    .Columns("Y").Value = ttd
    .Columns("X").Value = initial
    End With
    End If
    Next i

    Range("AA1").Select
    ActiveWindow.ScrollColumn = 1
    ActiveWindow.ScrollRow = 1
    Unload Me
    End If


    End Sub



    Private Sub UserForm_Initialize()
    Dim ws As Worksheet
    Set ws = Worksheets("Costumers")

    With noinvoice
    .Value = Format(Val(Cells(Rows.Count, "B").End(xlUp)) + 1, "0000") & "/" & Format(Month(Date), "00") & "/BMO" & "/" & Right(Year(Date), 2)
    .Enabled = False
    End With

    Me.Tanggal.Value = Format(Date, "short Date")

    Me.initial.Value = Range("LoggedInAs").Value

    For Each cCostumers1 In ws.Range("AlamatCostumers")
    With Me.Costumers1
    .AddItem cCostumers1.Value
    .List(.ListCount - 1, 1) = cCostumers1.Offset(0, 4).Value
    End With
    Next cCostumers1

    End Sub


    Private Sub UserForm_QueryClose(Cancel As Integer, _
    CloseMode As Integer)
    If CloseMode = vbFormControlMenu Then
    Cancel = True
    MsgBox "Please use the close button!!"
    End If
    End Sub

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
  •