0% found this document useful (0 votes)
14 views34 pages

Vba 2

Uploaded by

Akanksha Bhagat
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views34 pages

Vba 2

Uploaded by

Akanksha Bhagat
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 34

Contents

74-1............................................................................................................................................................................... 2
74-2............................................................................................................................................................................... 3
74-3............................................................................................................................................................................... 4
74-1
Private Sub CommandButton1_Click()

Dim x_datatype(6)

x_datatype(0) = "AKANKSHA"

x_datatype(1) = 125

x_datatype(2) = "A.R.BHAGAT"

x_datatype(3) = 150.83

x_datatype(4) = #12/15/1972#

x_datatype(5) = "95"

x_datatype(6) = "BHAGAT"

Cells(4, 6) = x_datatype(0)

Cells(5, 6) = x_datatype(1)

Cells(6, 6) = x_datatype(2)

Cells(7, 6) = x_datatype(3)

Cells(8, 6) = x_datatype(4)

Cells(9, 6) = x_datatype(5)

Cells(10, 6) = x_datatype(6)

End Sub

Private Sub CommandButton2_Click()

Dim a_datatype(6)

a_datatype(0) = "AKANKSHA"

a_datatype(1) = "AVNI"

a_datatype(2) = "A.R.BHAGAT"

a_datatype(3) = "Asha"

a_datatype(4) = "ASTHA"

a_datatype(5) = "Alpa"

a_datatype(6) = "BHAGAT"

Cells(20, 6) = a_datatype(0)

Cells(21, 6) = a_datatype(1)

Cells(22, 6) = a_datatype(2)

Cells(23, 6) = a_datatype(3)
Cells(24, 6) = a_datatype(4)

Cells(25, 6) = a_datatype(5)

Cells(26, 6) = a_datatype(6)

End Sub

74-2
Private Sub CommandButton1_Click()

Dim Rollno(1 To 3) As Integer

Dim Stud_Name(1 To 3) As String

Dim Stud_Marks1(1 To 3, 1 To 3) As Integer

Dim Stud_Marks2(1 To 3, 1 To 3) As Integer

Dim Stud_Marks3(1 To 3, 1 To 3) As Integer

Dim i As Integer

Dim j As Integer

Dim Total As Integer

Dim Per As Double

For i = 1 To 3

Rollno(i) = InputBox("Enter Your Rollno", "Data Entry")

Stud_Name(i) = InputBox("Enter Your Name")

MsgBox ("Enter Your 3 Subject Marks")

For j = 1 To 1

Stud_Marks1(i, 1) = InputBox("Enter your Mark 1")

Stud_Marks2(i, 2) = InputBox("Enter Your Mark 2")

Stud_Marks3(i, 3) = InputBox("Enter Your Mark 3")

Total = Stud_Marks1(i, 1) + Stud_Marks2(i, 2) + Stud_Marks3(i, 3)

Per = (Total * 100) / 300

Cells(i + 4, 2) = Rollno(i)

Cells(i + 4, 3) = Stud_Name(i)

Cells(i + 4, 4) = Stud_Marks1(i, 1)

Cells(i + 4, 5) = Stud_Marks2(i, 2)

Cells(i + 4, 6) = Stud_Marks3(i, 3)

Cells(i + 4, 7) = Total

Cells(i + 4, 8) = Per

Next j

Next i
End Sub
74-3
Private Sub CommandButton1_Click()

Dim akanksha() As String

ReDim akanksha(4) As String

akanksha(1) = "Misha"

akanksha(2) = "Daksha"

akanksha(3) = "Dinesh"

akanksha(4) = "Mansi"

MsgBox akanksha(1) & "," & akanksha(2) & "," & akanksha(3) & "," & akanksha(4)

End Sub

Private Sub CommandButton2_Click()

Dim akanksha() As String

ReDim akanksha(4) As String

akanksha(1) = "Misha"

akanksha(2) = "Daksha"

akanksha(3) = "Dinesh"

akanksha(4) = "Mansi"

ReDim akanksha(5) As String


akanksha(5) = "Asha"

akanksha(2) = "Daksha"

MsgBox akanksha(1) & "," & akanksha(2) & "," & akanksha(3) & "," & akanksha(4) & "," & akanksha(5)

End Sub

Private Sub CommandButton3_Click()

Dim akanksha() As String

ReDim akanksha(4) As String

akanksha(1) = "Nisha"

akanksha(2) = "Daksha"

akanksha(3) = "Dinesh"

akanksha(4) = "Nansi"

ReDim Preserve akanksha(5) As String

akanksha(5) = "Asha"

akanksha(2) = "Daksha"

MsgBox akanksha(1) & "," & akanksha(2) & "," & akanksha(3) & "," & akanksha(4) & "," & akanksha(5)
End Sub

You might also like