Consulting

Results 1 to 8 of 8

Thread: VBA Query

  1. #1

    VBA Query

    Hi Friends,

    Hope you are doing good.

    I am beginner of this forum and vba codes.i am preparing small worksheet for my small grocery. I just wanted to know when i click the macro command button in the attached worksheet in "PAYMENT' , Name shown in command button has to appear the PAYMENT table which is blank (Start from the empty cells in Items(to be appear in Yellow highlighted cells).
    To make more clear, While clicking command button "PEN","PENCIL","ERASOR" it should be appear in payment table "ITEM-1","Item-2","ITEM-3" likewise start from top cell which is blank.(I have more than 100 items)

    So Kindly help me.
    Attached Files Attached Files
    Last edited by dawoodmpm; 01-22-2019 at 11:55 PM. Reason: grammer mistake

  2. #2
    VBAX Mentor 大灰狼1976's Avatar
    Joined
    Dec 2018
    Location
    SuZhou China
    Posts
    479
    Location
    Hi dawoodmpm!
    Sub Button3_Click()
    Dim DCC As Long
    Dim ABC As Worksheet
    Set ABC = Sheets("PAYMENT")
    DCC = Sheets("PAYMENT").Range("C" & Rows.Count).End(xlUp).Column
    With ABC
      .Cells(DCC + 5, 3).Value = .Buttons("Button 3").Text
    End With
    End Sub

  3. #3
    VBAX Mentor 大灰狼1976's Avatar
    Joined
    Dec 2018
    Location
    SuZhou China
    Posts
    479
    Location
    sorry
    Sub Button3_Click()
    Dim DCC As Long
    Dim ABC As Worksheet
    Set ABC = Sheets("PAYMENT")
    DCC = Sheets("PAYMENT").Range("C" & Rows.Count).End(xlUp).Row
    With ABC
      .Cells(DCC + 1, 3).Value = .Buttons("Button 3").Text
    End With
    End Sub

  4. #4
    VBAX Mentor 大灰狼1976's Avatar
    Joined
    Dec 2018
    Location
    SuZhou China
    Posts
    479
    Location
    There is data in 25 row and more than 40000 row, must be deleted first.

  5. #5
    Thanks Mr.大灰狼1976

    It is really great and work well.But when i press t command button,it is pasting on the same cell instead of first blank cell.so please advise how to make the text to be appear in the first blank cell whatever the command button pressed

    Thanks

    Dawood.

  6. #6
    VBAX Mentor 大灰狼1976's Avatar
    Joined
    Dec 2018
    Location
    SuZhou China
    Posts
    479
    Location
    Hi dawoodmpm!
    Please refer to the attachment.
    Attached Files Attached Files

  7. #7

    yes resolved

    Thank you Mr.大灰狼1976

    It really works well.Once again i really thank you for your help.
    Last edited by dawoodmpm; 01-31-2019 at 03:46 AM. Reason: to update the thread status

  8. #8
    VBAX Mentor 大灰狼1976's Avatar
    Joined
    Dec 2018
    Location
    SuZhou China
    Posts
    479
    Location
    that's alright!
    Please mark it as resolved.

Posting Permissions

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