Hi,
Can some please help me to correct this mcro code - this I am using to fill a range with alphabatical list.
Above code is giving error "Named argument error" on following line : "Type:=8"
I am using Excel 2003.
Please help where the code is going wrong.
Regards,
Can some please help me to correct this mcro code - this I am using to fill a range with alphabatical list.
Code:
Sub AlphaFill()
Dim Cell, CellChars
Dim Default, Prompt, Title
Dim rangeSelected As Range
Dim UpperCase As Boolean
Title = "AlphaFill Cell Selection"
Default = Selection.Address
Prompt = vbCrLf _
& "Use mouse in conjunction with " _
& "SHIFT and CTRL keys to" & vbCrLf _
& "click and drag or type in name(s) " _
& "of cell(s) to AlphaFill" & vbCrLf & vbCrLf _
& "Currently selected cell(s): " & Selection.Address
On Error Resume Next
Set rangeSelected = InputBox(Prompt, Title, Default, Type:=8)
If rangeSelected Is Nothing Then Exit Sub
UpperCase = True
Randomize
For Each Cell In rangeSelected
CellChars = Chr(64 + Int((Rnd * 26) + 1))
If Not UpperCase Then CellChars = LCase(CellChars)
Cell.Value = CellChars
Next
End Sub
Above code is giving error "Named argument error" on following line : "Type:=8"
I am using Excel 2003.
Please help where the code is going wrong.
Regards,