I can't pass an array to a procedure.
A B C
1 Name Zip Address
2 XYZ Telephone Inc. 567 1234 First Street
On the userform1 I have only one button.
My code.
Sub Archive()
Dim stickers(3) As String
stickers(1) = Cells(2, 1).Value
stickers(2) = Cells(2, 2).Value
stickers(3) = Cells(2, 3).Value
MsgBox (stickers(1) & Chr(10) & stickers(2) & Chr(10) & stickers(3))
UserForm1.Show
End Sub
Sub Spread(stickers())
Sheets(2).Select
Cells(2, 1).Value = stickers(1)
Cells(2, 2).Value = stickers(2)
Cells(2, 3).Value = stickers(3)
End Sub
Sub Archive()
Dim stickers(3) As String
stickers(1) = Cells(2, 1).Value
stickers(2) = Cells(2, 2).Value
stickers(3) = Cells(2, 3).Value
MsgBox (stickers(1) & Chr(10) & stickers(2) & Chr(10) & stickers(3))
UserForm1.Show
End Sub
Sub Spread(stickers())
Sheets(2).Select
Cells(2, 1).Value = stickers(1)
Cells(2, 2).Value = stickers(2)
Cells(2, 3).Value = stickers(3)
End Sub
Private Sub CommandButton1_Click()
Call Spread(stickers())
End Sub
So, the question. How can I call the sub Spread?
A B C
1 Name Zip Address
2 XYZ Telephone Inc. 567 1234 First Street
On the userform1 I have only one button.
My code.
Sub Archive()
Dim stickers(3) As String
stickers(1) = Cells(2, 1).Value
stickers(2) = Cells(2, 2).Value
stickers(3) = Cells(2, 3).Value
MsgBox (stickers(1) & Chr(10) & stickers(2) & Chr(10) & stickers(3))
UserForm1.Show
End Sub
Sub Spread(stickers())
Sheets(2).Select
Cells(2, 1).Value = stickers(1)
Cells(2, 2).Value = stickers(2)
Cells(2, 3).Value = stickers(3)
End Sub
Sub Archive()
Dim stickers(3) As String
stickers(1) = Cells(2, 1).Value
stickers(2) = Cells(2, 2).Value
stickers(3) = Cells(2, 3).Value
MsgBox (stickers(1) & Chr(10) & stickers(2) & Chr(10) & stickers(3))
UserForm1.Show
End Sub
Sub Spread(stickers())
Sheets(2).Select
Cells(2, 1).Value = stickers(1)
Cells(2, 2).Value = stickers(2)
Cells(2, 3).Value = stickers(3)
End Sub
Private Sub CommandButton1_Click()
Call Spread(stickers())
End Sub
So, the question. How can I call the sub Spread?