+ Reply to Thread
Results 1 to 6 of 6

Convert Range to String

Hybrid View

erice Convert Range to String 02-07-2018, 01:05 PM
xlnitwit Re: Convert Range to String 02-07-2018, 01:12 PM
gmr4evr1 Re: Convert Range to String 02-07-2018, 01:13 PM
queuesef Re: Convert Range to String 02-07-2018, 01:29 PM
erice Re: Convert Range to String 02-07-2018, 02:47 PM
gmr4evr1 Re: Convert Range to String 02-07-2018, 03:02 PM
  1. #1
    Forum Contributor
    Join Date
    06-27-2013
    Location
    Nebraska
    MS-Off Ver
    Office 365
    Posts
    115

    Convert Range to String

    Hello,

    I am trying to take the number that appears in the cell Range(B1:C1) and have it used in a string. B1:C1 is a merged cell that I cannot change in the sheet. Eventually I want to use the string as the subject line of an email, but for this time I am having it appear in a message box.

    Sub Send_Update()
    
    Dim rng As Range
    Dim EPR As String
    
    Set rng = Range("B1:C1")
    EPR = rng.Address(RowAbsolute, ColumnAbsolute)
    MsgBox (EPR & " was updated")
      
    
    End Sub>
    Attached Files Attached Files
    Last edited by erice; 02-07-2018 at 01:11 PM.

  2. #2
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Convert Range to String

    If you want the cell content, you can just use
    MsgBox Range("B1").Value & " was updated"
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  3. #3
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Convert Range to String

    Or ..
    Sub Send_Update()
    
    Dim rng As Range
    Dim EPR As String
    
    Set rng = Range("B1")
    EPR = rng.Value
    MsgBox (EPR & " was updated")
      
    
    End Sub
    Since B1:C1 are merged cells, you only have to use the value from B1
    Then again, xlnitwit's solution is much easier.
    Last edited by gmr4evr1; 02-07-2018 at 01:46 PM.
    1N73LL1G3NC3 15 7H3 4B1L17Y 70 4D4P7 70 CH4NG3 - 573PH3N H4WK1NG
    You don't have to add Rep if I have helped you out (but it would be nice), but please mark the thread as SOLVED if your issue is resolved.

    Tom

  4. #4
    Valued Forum Contributor
    Join Date
    11-02-2016
    Location
    NY
    MS-Off Ver
    2010
    Posts
    459

    Re: Convert Range to String

    Why do you need Merged cell/wrapped cell in B1:C1 ? I would eliminate it. Create a simple formula/function: mySt = sheet1.Range("B1") - You can verify it in immediate window ( debug.Print cstr(myst) ) or use Cstr( ) .

  5. #5
    Forum Contributor
    Join Date
    06-27-2013
    Location
    Nebraska
    MS-Off Ver
    Office 365
    Posts
    115

    Re: Convert Range to String

    Thank you all for the responses. Each one of these solutions seemed to work. I would like to get rid of the merged cell, but the actual sheet that this is going in (not the one attached) was one that I inherited and I cannot change it without fixing a lot of editing the other formulas and Macros.

    Thanks again!

  6. #6
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Convert Range to String

    You're welcome.

+ 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] Convert string to range
    By maw230 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-18-2015, 02:44 PM
  2. [SOLVED] Convert String from Excel Range.Value to Equation in VBA
    By Kalithro in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-17-2013, 03:50 PM
  3. Convert string to range
    By ZacharyBass in forum Excel General
    Replies: 2
    Last Post: 11-26-2012, 12:58 AM
  4. Convert String to Row Range
    By bdb1974 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-03-2011, 04:07 PM
  5. Convert string to range
    By mavve2004 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-18-2010, 07:07 PM
  6. Convert string to range
    By Cumberland in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-26-2006, 06:32 AM
  7. [SOLVED] convert a string to range?
    By JK in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-19-2006, 08:10 PM

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