+ Reply to Thread
Results 1 to 8 of 8

Dim variable named after a string's content

  1. #1
    Registered User
    Join Date
    05-07-2015
    Location
    Angouleme, France
    MS-Off Ver
    2013
    Posts
    48

    Dim variable named after a string's content

    Hello !

    Another weird question from me It may look simple but I have no clue how to do it :

    In my VBA code, I gave a string the value "part1" & "part2". What I want to do now is creating another string that will be called "part1part2", but if I write
    Please Login or Register  to view this content.
    it will not work, of course.

    If anyone have an idea, I will be much grateful !

    Thanks,

    François
    Last edited by AstroZelda; 05-11-2015 at 09:25 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    08-22-2011
    Location
    Auckland
    MS-Off Ver
    Excel 2019
    Posts
    716

    Re: Dim varible named after a string's content

    As far as I know a variable can hold only the 1 value

  3. #3
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Dim varible named after a string's content

    No, you can't do that, why would you want to?

  4. #4
    Registered User
    Join Date
    05-07-2015
    Location
    Angouleme, France
    MS-Off Ver
    2013
    Posts
    48

    Re: Dim varible named after a string's content

    Quote Originally Posted by Kyle123 View Post
    No, you can't do that, why would you want to?
    I wanted that because I'll have to run a loop and Dim as many variables as the loop occurs...

  5. #5
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Dim varible named after a string's content

    Why can't you use an array?

  6. #6
    Registered User
    Join Date
    05-07-2015
    Location
    Angouleme, France
    MS-Off Ver
    2013
    Posts
    48

    Re: Dim varible named after a string's content

    So I can write this, right ?

    Please Login or Register  to view this content.

  7. #7
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Dim variable named after a string's content

    You'd want:
    Please Login or Register  to view this content.
    But yes

  8. #8
    Registered User
    Join Date
    05-07-2015
    Location
    Angouleme, France
    MS-Off Ver
    2013
    Posts
    48

    Re: Dim variable named after a string's content

    Shouldn't I Dim the array at the begining too ?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] clear dynamic named range content
    By intex in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 07-12-2014, 08:29 AM
  2. replace each content linked together to a named range
    By dvb_24 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-24-2011, 03:11 AM
  3. how to Read content or text of cells Named
    By Raju A in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-06-2008, 02:25 PM
  4. create a Named Range via VBA based on cell content
    By carsto in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-30-2007, 04:44 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1