lezawang
Well-known Member
- Joined
- Mar 27, 2016
- Messages
- 1,805
- Office Version
- 2016
- Platform
- Windows
Hi
I wrote the code below to fill cells with random char. It does not work. I also have another question. Why Char() is not part of Application.Worksheetfunction?
I thought all excel functions that you can find in Fx, you can find then under Worksheetfunction. But that is not the case. I found Application.Chr function and I tried to use it in my code blow. Thank you so much.
I wrote the code below to fill cells with random char. It does not work. I also have another question. Why Char() is not part of Application.Worksheetfunction?
I thought all excel functions that you can find in Fx, you can find then under Worksheetfunction. But that is not the case. I found Application.Chr function and I tried to use it in my code blow. Thank you so much.
Code:
Sub selection_fill2()
'fill selection with random number
Dim xcell As Range
Dim x As Integer
For Each xcell In Selection
x = Application.WorksheetFunction.RandBetween(1, 56)
xcell.Value = x
xcell.vaule = Application.Chr(x)
Next xcell
End Sub