HomeExcelExcel VBA Multiple Sheet Data Entry Software for Beginners | Excel VBA...

Excel VBA Multiple Sheet Data Entry Software for Beginners | Excel VBA Userform Project | VedantSri

5/5 - (1 vote)

Excel VBA Multiple Sheet Data Entry Software for Beginners | Excel VBA Userform Project | VedantSri

Excel Userform Multi Sheet Data Entry Software

Aap Excel me VBA code likh kar ek hi UserForm ke dwara alag-alag sheets (Aadhar, PAN Card, ITR) par data entry kar sakte hain. niche diye gaye steps ko follow kren.

Step 1: Sheets ka Setup

  1. Aapke Excel workbook me teen sheets honi chahiye:
    • Aadhar
    • PAN Card
    • ITR
  2. Har sheet me column headings specify karen jaise:
    • Aadhar: Name, Aadhar Number, Address
    • PAN Card: Name, PAN Number, DOB
    • ITR: Name, ITR Number, Amount

Step 2: UserForm Design

  1. Developer Tab → Visual Basic Editor (Alt + F11).
  2. Insert → UserForm.
  3. UserForm me fields add karen:
    • TextBox: Textbox1, Textbox2, Textbox3.
    • ComboBox: Combobox1 (Options: Aadhar, PAN Card, ITR).
    • CommandButton: Commandbutton1.

Step 3: VBA Code

UserForm ke code window me niche diya code paste karen:

'DataEntry Button ka code hai
Private Sub CommandButton1_Click()
Dim ws As Worksheet
Dim lastRow As Long
Dim category As String
Dim name As String, number As String, extra As String

'Textbox aur combobox ke name ka code hai
category = ComboBox1.Value
name = TextBox1.Value
number = TextBox2.Value
extra = TextBox3.Value

'ComboBox me Listed Word ko Sheet se Connect krne ka code
If category = "Aadhar" Then
Set ws = ThisWorkbook.Sheets("Aadhar")
ElseIf category = "PAN Card" Then
Set ws = ThisWorkbook.Sheets("PAN Card")
ElseIf category = "ITR" Then
Set ws = ThisWorkbook.Sheets("ITR")
Else
MsgBox "Please select a valid category.", vbExclamation
Exit Sub
End If

'Next Empty Row find krne ka code hai
lastRow = ws.Cells(ws.Rows.Count, 1).End(xlUp).Row + 1

'Data ko Selected Combobox List se Sheet me Entry ka Code
ws.Cells(lastRow, 1).Value = name
ws.Cells(lastRow, 2).Value = number
ws.Cells(lastRow, 3).Value = extra

'Entry ke Baad Userform ko Clear krne ka code hai
TextBox1.Value = ""
TextBox2.Value = ""
TextBox3.Value = ""
ComboBox1.Value = ""

MsgBox "Data added successfully to " & category & " sheet.", vbInformation
End Sub

Step 4: Testing

  1. Excel workbook save karein (Macro-Enabled Workbook – .xlsm).
  2. UserForm ko run karein (Alt + F8 → UserForm1 → Run).
  3. Form bhar kar “Submit” button click karein.
VedantSri Sessional Reward Ceremony Toppers Students Image
VedantSri Sessional Reward Ceremony Toppers Students
3,600FansLike
12,900FollowersFollow
20FollowersFollow
456FollowersFollow
97,000SubscribersSubscribe
Call Now Button