I am using Visual Basic for Applications to convert a number to the same number of single quotes. For example, if the number is 6, then I need 6 single quotes in succession. The logic is easy:
Above code does not work, but the logic is correct. I need the code to replace the "6" with ' ' ' ' ' '
The below code DOES work for letters though:
So, the code will replace the number "6" with "aaaaaa"
My logic works only if I use characters, but does not work if I use single quotes. I need single quotes to replace the number, this is important. Is there is some kind of data type I need to use for single quotes other than "string?"
Code:
Dim strOctave As Integer, strOctaveNew as String If strOctave = "6" Then strOctaveNew = " ' ' ' ' ' ' " End If
The below code DOES work for letters though:
Code:
Dim strOctave As Integer, strOctaveNew as String If strOctave = "6" Then strOctaveNew = "aaaaaa" End If
My logic works only if I use characters, but does not work if I use single quotes. I need single quotes to replace the number, this is important. Is there is some kind of data type I need to use for single quotes other than "string?"
Comment