ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   getting cell value with all format without paste (https://www.excelbanter.com/excel-programming/316577-getting-cell-value-all-format-without-paste.html)

hke[_20_]

getting cell value with all format without paste
 

Hi folks!

I`m using excel2latex (check it out :) :
http://www.jam-software.com/freeware/index.shtml ) ,

but did find need to assign the latex command \small (which control
fontsize) straight into excel, before passing a range to the late
Sub.

I`m trying

ActiveCell.FormulaR1C1 = "\small" & Chr(123) & Range("A1").Value
Chr(125)

,which works fine (the chr123 and 125 are { and } respectivel
(latex).)

Problem is I want the same numberformat in A1 and ActiveCell, but
Range("A1").Value gives for example 11 in ActiveCell even if A1 say
11,0.
I can`t make it work with ActiveSheet.Paste in place of th
Range("A1").Value.

Anyone ever experienced someting similar, and possibly solved it?how

--
hk
-----------------------------------------------------------------------
hke's Profile: http://www.excelforum.com/member.php...nfo&userid=155
View this thread: http://www.excelforum.com/showthread.php?threadid=27767


Dave Peterson[_5_]

getting cell value with all format without paste
 
I'm guessing that in 11,0 the comma is the decimal point.

Maybe this:

ActiveCell.FormulaR1C1 = "\small" & Chr(123) & Range("A1").Text & Chr(125)

why not use those characters?

ActiveCell.Value = "\small{" & Range("A1").Text & "}"

(I like to use .formula only if I'm changing the formula. Excel doesn't seem to
care, but it looks nicer to me.)





hke wrote:

Hi folks!

I`m using excel2latex (check it out :) :
http://www.jam-software.com/freeware/index.shtml ) ,

but did find need to assign the latex command \small (which controls
fontsize) straight into excel, before passing a range to the latex
Sub.

I`m trying

ActiveCell.FormulaR1C1 = "\small" & Chr(123) & Range("A1").Value &
Chr(125)

,which works fine (the chr123 and 125 are { and } respectively
(latex).)

Problem is I want the same numberformat in A1 and ActiveCell, but
Range("A1").Value gives for example 11 in ActiveCell even if A1 says
11,0.
I can`t make it work with ActiveSheet.Paste in place of the
Range("A1").Value.

Anyone ever experienced someting similar, and possibly solved it?how?

--
hke
------------------------------------------------------------------------
hke's Profile: http://www.excelforum.com/member.php...fo&userid=1550
View this thread: http://www.excelforum.com/showthread...hreadid=277670


--

Dave Peterson


All times are GMT +1. The time now is 12:25 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com