ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   VB Assigning Values to a Series of Strings (https://www.excelbanter.com/excel-discussion-misc-queries/38804-vbulletin-assigning-values-series-strings.html)

cincode5

VB Assigning Values to a Series of Strings
 
Hello,

In the VB Editor, I need to assign each letter of a 13 character string
(named JobScope) to individual Variables (K1 through K13). I'm using a
For/Next Loop to extract the indiv characters but cannot figure out how to
define the Variable K(x) where x = 1 to 13. Any suggestions?
--
Regards...

Henry

cincode5,

Try making K an array with 14 elements (VBA numbers the first element as 0)
Then you can use the method you're trying at the moment.
For X = 1 To 13
K(X) = etc.
~
~
Next X

The only other change you'll have to make is how you address the variables
elsewhere. E.g, K5 will become K(5).

Henry


"cincode5" wrote in message
...
Hello,

In the VB Editor, I need to assign each letter of a 13 character string
(named JobScope) to individual Variables (K1 through K13). I'm using a
For/Next Loop to extract the indiv characters but cannot figure out how to
define the Variable K(x) where x = 1 to 13. Any suggestions?
--
Regards...





All times are GMT +1. The time now is 07:38 AM.

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