T
TD
High everyone,
Love the site, and finally I have question to post!
I wish to make my code more efficient by cycling through a smaller
piece of code as follows:
Sub test()
Dim var As Variant
Dim No As Single
Dim Head1 As String
Head1 = "Test Header 1"
No = 1
While No < 2
var = ("Head" & No)
Range("A1").Offset(0, No).Value = var
No = No + 1
Wend
End Sub
The issue I am getting is the Var is inputting "Head1" instead of
"Test Header 1" into my worksheet.
If anyone can help I'd bre greatly apreciative.
Thanks
Tim
Love the site, and finally I have question to post!
I wish to make my code more efficient by cycling through a smaller
piece of code as follows:
Sub test()
Dim var As Variant
Dim No As Single
Dim Head1 As String
Head1 = "Test Header 1"
No = 1
While No < 2
var = ("Head" & No)
Range("A1").Offset(0, No).Value = var
No = No + 1
Wend
End Sub
The issue I am getting is the Var is inputting "Head1" instead of
"Test Header 1" into my worksheet.
If anyone can help I'd bre greatly apreciative.
Thanks
Tim