1

I am new in using excel vba, i have created a userform (Collection_form)that i will input different amounts from different members from a validation list . Objective: i want to update all cells based on the input from the collection form in a different worksheet(Collection_Report) sheet upon clicking the Submit button. The data should update succesfully upon clicking the submit button and clear the content(Collection_form) ready to capture data for the next member.

Submit Code:
Sub Submit_Click()
'
' Submit_Click Macro
'

'

'name

    Sheets("Collection_Form").Select

    Range("E14:G14").Select
    Selection.Copy
    Sheets("Collection_Report").Select
    Range("B1000").Select
    Selection.End(xlUp).Select

ActiveCell.Offset(1, 0).Select

'ActiveCell.Offset(0, 1).Select
'ActiveSheet.Paste
'ActiveCell.Offset(0, -1).Select
'ActiveCell.Offset(1, 0).Select

Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False

'Month

Sheets("Collection_Form").Select
Range("E9:F9").Select
Selection.Copy
Sheets("Collection_Report").Select
ActiveCell. Offset(0, 1).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False

'Attendance
Sheets("Collection_Form").Select
Range("E11").Select
Selection.Copy
Sheets("Collection_Report").Select
ActiveCell. Offset(0, 1).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False



'Loan Interest

Sheets("Collection_Form").Select
Range("AV17").Select
Selection.Copy
Sheets("Collection_Report").Select
ActiveCell. Offset(0, 1).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False

'Loan Payment
Sheets("Collection_Form").Select
Range("AV18").Select
Selection.Copy
Sheets("Collection_Report").Select
ActiveCell. Offset(0, 1).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False

'MGR
Sheets("Collection_Form").Select
Range("AV19").Select
Selection.Copy
Sheets("Collection_Report").Select
ActiveCell. Offset(0, 1).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False

'SHARES
Sheets("Collection_Form").Select
Range("AV20").Select
Selection.Copy
Sheets("Collection_Report").Select
ActiveCell. Offset(0, 1).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False

'INSURANCE
Sheets("Collection_Form").Select
Range("AV21").Select
Selection.Copy
Sheets("Collection_Report").Select
ActiveCell. Offset(0, 1).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False


'OTHER
Sheets("Collection_Form").Select
Range("AV22").Select
Selection.Copy
Sheets("Collection_Report").Select
ActiveCell. Offset(0, 1).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False

'MEMBERS
Sheets("Collection_Form").Select
Range("AV23").Select
Selection.Copy
Sheets("Collection_Report").Select
ActiveCell. Offset(0, 1).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False


'FINE
Sheets("Collection_Form").Select
Range("AV24").Select
Selection.Copy
Sheets("Collection_Report").Select
ActiveCell. Offset(0, 1).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False


'BANK TOTAL
Sheets("Collection_Form").Select
Range("G25").Select
Selection.Copy
Sheets("Collection_Report").Select
ActiveCell. Offset(0, 1).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False

'CASH TOTAL
Sheets("Collection_Form").Select
Range("H25").Select
Selection.Copy
Sheets("Collection_Report").Select
ActiveCell. Offset(0, 1).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
Application.CutCopyMode = False


    ActiveWorkbook. Save
MsgBox ("Record Saved")

End Sub
BigBen
  • 46,229
  • 7
  • 24
  • 40
  • Welcome to SO/VBA... [this question](https://stackoverflow.com/questions/10714251/how-to-avoid-using-select-in-excel-vba) may be helpful. – BigBen Mar 02 '20 at 13:27

0 Answers0