ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Concatenate Variables (https://www.excelbanter.com/excel-programming/379629-concatenate-variables.html)

[email protected][_2_]

Concatenate Variables
 
Hey folks,

I'm wondering if you could help me out here. My overall goal is to loop
through a set of string variable that I have defined in my code, and
display these strings on a worksheet. Something like this:

Dim hello1 As String
Dim hello2 As String

Hello1 = "Hey"
Hello2 = "What's Up"

For i = 1 to 2
Sheets(1).Cells(1, i).Value = Hello & i
Next i

If you know of another way to loop through variables stored in code I'm
all ears. I'm new to all this.

Thanks in advance,

HMiller


[email protected][_2_]

Concatenate Variables
 
Thank you much, Alok. Worked Great!


[email protected][_2_]

Concatenate Variables
 
Thank you much, Alok. Worked Great!



All times are GMT +1. The time now is 06:59 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com