+ Reply to Thread
Results 1 to 9 of 9

String to range conversion

  1. #1
    Registered User
    Join Date
    04-07-2019
    Location
    Montreal
    MS-Off Ver
    2010
    Posts
    14

    String to range conversion

    Hi all,

    Currently, I'm having some difficulties in setting a range using two string values. Is there any idea how can I combine both the string values into a range.

    For example, string variable Col consists of "B" while string variable k has a value of "3".
    I would like excel to call for the range "B3".

    Instead of .range("B3")
    is it possible to to call for .range(Col & k1)
    Appreciate any assistance.
    Last edited by ElvinK; 06-24-2019 at 09:34 AM.

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: String to range conversion

    That would be
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    04-07-2019
    Location
    Montreal
    MS-Off Ver
    2010
    Posts
    14

    Re: String to range conversion

    Hi jindon, thank you for the prompt reply.

    However, I would like to print something in range(col & k) through a If-Else command

    I've called the cell through an example as follows

    Please Login or Register  to view this content.
    However, I keep getting an error with that particular line.
    Any idea whats going on ?

    Thank you once again.

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: String to range conversion

    What kind of error are you getting?

  5. #5
    Registered User
    Join Date
    04-07-2019
    Location
    Montreal
    MS-Off Ver
    2010
    Posts
    14

    Re: String to range conversion

    Object defined or application defined error.

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: String to range conversion

    Then most probably value of col and/or k are not properly assigned.

  7. #7
    Registered User
    Join Date
    04-07-2019
    Location
    Montreal
    MS-Off Ver
    2010
    Posts
    14

    Re: String to range conversion

    Quote Originally Posted by jindon View Post
    Then most probably value of col and/or k are not properly assigned.
    Please Login or Register  to view this content.
    The above is the code. Would you be able to help me do some troubleshooting?

  8. #8
    Registered User
    Join Date
    04-07-2019
    Location
    Montreal
    MS-Off Ver
    2010
    Posts
    14

    Re: String to range conversion

    Hi jindon,
    I think I've managed to solve it.
    It was a variable mismatch error.

    Thank you for assistance once again.

  9. #9
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: String to range conversion

    OK, that's good.

+ 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. put a string into a date but WITHOUT conversion.
    By andreagiugio in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-21-2016, 11:56 AM
  2. Weird string to int conversion
    By Quando in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-23-2013, 12:06 PM
  3. String conversion formula?
    By JGTExcel in forum Excel General
    Replies: 3
    Last Post: 02-10-2012, 01:12 PM
  4. Problem with Type conversion- String to Int
    By meen2525 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-31-2011, 09:23 AM
  5. String to Date Conversion
    By dasreinfeld in forum Excel General
    Replies: 10
    Last Post: 11-18-2010, 07:15 PM
  6. InputBox String Conversion
    By Paul987 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-20-2007, 03:51 PM
  7. Simple String Conversion - HELP
    By prepotency in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-10-2005, 10:03 AM

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