Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 460
Default FROM and TO Cell References in VBA

This: =TEXT($L2,"""from"" 0.0""%"";"""" 0.0""%"";""""")&" to
"&TEXT($M2,"0.0%")&","

yields this: from 84.8% to 8451.0%,

I need to have it say: from 84.8% to 84.5%, .

(So, what is the proper way to join parts of a VBA statement together,
anyway)?

Please advise.
DOUG ECKERT
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,124
Default FROM and TO Cell References in VBA

Sub putemtogether()
MsgBox "From " & Format(Range("l2"), "00.0%") _
& " to " & Format(Range("m2"), "00.0%")
End Sub


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"DOUG" wrote in message
...
This: =TEXT($L2,"""from"" 0.0""%"";"""" 0.0""%"";""""")&" to
"&TEXT($M2,"0.0%")&","

yields this: from 84.8% to 8451.0%,

I need to have it say: from 84.8% to 84.5%, .

(So, what is the proper way to join parts of a VBA statement together,
anyway)?

Please advise.
DOUG ECKERT


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,722
Default FROM and TO Cell References in VBA

rather than use the TEXT function to insert from/to, it might be simpler to
read if you concatenate them in like so:

ActiveCell.Formula = "=""from ""&TEXT($L2,""0.0%"")& _
"" to ""&TEXT($M2,""0.0%"")&"","""

--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"DOUG" wrote:

This: =TEXT($L2,"""from"" 0.0""%"";"""" 0.0""%"";""""")&" to
"&TEXT($M2,"0.0%")&","

yields this: from 84.8% to 8451.0%,

I need to have it say: from 84.8% to 84.5%, .

(So, what is the proper way to join parts of a VBA statement together,
anyway)?

Please advise.
DOUG ECKERT

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default FROM and TO Cell References in VBA

With .848 in A1 and .8451 in B1 try the below

="from " & TEXT(A1,"0.0%") & " to " & TEXT(B1,"0.0%")

If this post helps click Yes
---------------
Jacob Skaria


"DOUG" wrote:

This: =TEXT($L2,"""from"" 0.0""%"";"""" 0.0""%"";""""")&" to
"&TEXT($M2,"0.0%")&","

yields this: from 84.8% to 8451.0%,

I need to have it say: from 84.8% to 84.5%, .

(So, what is the proper way to join parts of a VBA statement together,
anyway)?

Please advise.
DOUG ECKERT

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 460
Default FROM and TO Cell References in VBA

Jacob: That yielded "from 8482.0% to 8451.0%". I should preface that by
saying the source cells are expressed as 84.8 and 84.5, not formatted as
percentages. Should I divide by one hundred in the formula?

DOUG ECKERT


"Jacob Skaria" wrote:

With .848 in A1 and .8451 in B1 try the below

="from " & TEXT(A1,"0.0%") & " to " & TEXT(B1,"0.0%")

If this post helps click Yes
---------------
Jacob Skaria


"DOUG" wrote:

This: =TEXT($L2,"""from"" 0.0""%"";"""" 0.0""%"";""""")&" to
"&TEXT($M2,"0.0%")&","

yields this: from 84.8% to 8451.0%,

I need to have it say: from 84.8% to 84.5%, .

(So, what is the proper way to join parts of a VBA statement together,
anyway)?

Please advise.
DOUG ECKERT



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 460
Default FROM and TO Cell References in VBA

Jacob: I guessed right for once! Cell reference over 100 corrected the
formatting problem - er, uh, "challenge".

Thank you so much again.

PS, The VBA instructions for getcolortext still did not work. Advice is
welcome, of course.

Sincerely,
DOUG

"Jacob Skaria" wrote:

With .848 in A1 and .8451 in B1 try the below

="from " & TEXT(A1,"0.0%") & " to " & TEXT(B1,"0.0%")

If this post helps click Yes
---------------
Jacob Skaria


"DOUG" wrote:

This: =TEXT($L2,"""from"" 0.0""%"";"""" 0.0""%"";""""")&" to
"&TEXT($M2,"0.0%")&","

yields this: from 84.8% to 8451.0%,

I need to have it say: from 84.8% to 84.5%, .

(So, what is the proper way to join parts of a VBA statement together,
anyway)?

Please advise.
DOUG ECKERT

  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default FROM and TO Cell References in VBA

Happy to hear this helped.

If this post helps click Yes
---------------
Jacob Skaria


"DOUG" wrote:

Jacob: I guessed right for once! Cell reference over 100 corrected the
formatting problem - er, uh, "challenge".

Thank you so much again.

PS, The VBA instructions for getcolortext still did not work. Advice is
welcome, of course.

Sincerely,
DOUG

"Jacob Skaria" wrote:

With .848 in A1 and .8451 in B1 try the below

="from " & TEXT(A1,"0.0%") & " to " & TEXT(B1,"0.0%")

If this post helps click Yes
---------------
Jacob Skaria


"DOUG" wrote:

This: =TEXT($L2,"""from"" 0.0""%"";"""" 0.0""%"";""""")&" to
"&TEXT($M2,"0.0%")&","

yields this: from 84.8% to 8451.0%,

I need to have it say: from 84.8% to 84.5%, .

(So, what is the proper way to join parts of a VBA statement together,
anyway)?

Please advise.
DOUG ECKERT

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cell naming using cell references (VBA? Offset?) StephenT Excel Discussion (Misc queries) 2 June 24th 09 07:06 PM
convert relative cell references to absolute cell references via amacro? Dave F[_2_] Excel Discussion (Misc queries) 1 May 15th 08 04:43 PM
Help with converting a block of cells with Absolute and mixed references to relative references Vulcan Excel Worksheet Functions 3 December 13th 07 11:43 PM
How to rename references from range names to cell references Abbas Excel Discussion (Misc queries) 1 May 24th 06 06:18 PM
Transferring cell content between workbooks using cell references Kiwi Mike Excel Discussion (Misc queries) 2 November 27th 04 11:31 PM


All times are GMT +1. The time now is 08:05 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"