Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Cell naming using cell references (VBA? Offset?) | Excel Discussion (Misc queries) | |||
convert relative cell references to absolute cell references via amacro? | Excel Discussion (Misc queries) | |||
Help with converting a block of cells with Absolute and mixed references to relative references | Excel Worksheet Functions | |||
How to rename references from range names to cell references | Excel Discussion (Misc queries) | |||
Transferring cell content between workbooks using cell references | Excel Discussion (Misc queries) |