[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.excel.programming

Printing on notepad from excel worksheet... Please Help!!

riggimehta

12/13/2006 2:25:00 AM

Hi all,
Is there a way to print a number from excel sheet to notepad file and
not changing the format. For example when I try to print 78E-02 on the
notepad, it prints 0.78.

Secondly, while printing in notepad from VB(excel) for instance -
Print # 1 "Speed of car A ="; VarA
It leaves a blank after = sign.
Print results

Speed of car A = 250

Is there a way of printing the value of the variable without the
space??

Your help will be really appreciated.

Thanks,

Riggi

3 Answers

Dave Peterson

12/13/2006 2:48:00 AM

0

Does 78E-02 represent a number? If yes, then specify the format you want to
use.

Print #FileNum, "Speed of car A ="; Format(VarA, "00E-00")
or
Print #FileNum, "Speed of car A ="; Format(VarA, "0.00")





riggimehta@hotmail.com wrote:
>
> Hi all,
> Is there a way to print a number from excel sheet to notepad file and
> not changing the format. For example when I try to print 78E-02 on the
> notepad, it prints 0.78.
>
> Secondly, while printing in notepad from VB(excel) for instance -
> Print # 1 "Speed of car A ="; VarA
> It leaves a blank after = sign.
> Print results
>
> Speed of car A = 250
>
> Is there a way of printing the value of the variable without the
> space??
>
> Your help will be really appreciated.
>
> Thanks,
>
> Riggi

--

Dave Peterson

NickHK

12/13/2006 3:21:00 AM

0

Using
"Speed of car A ="; VarA
the ";" means print in the next column, the same as you see in the debug
window.
To control the output, build the string yourself :
"Speed of car A =" & VarA

NickHK

<riggimehta@hotmail.com> wrote in message
news:1165976709.088747.71750@j44g2000cwa.googlegroups.com...
> Hi all,
> Is there a way to print a number from excel sheet to notepad file and
> not changing the format. For example when I try to print 78E-02 on the
> notepad, it prints 0.78.
>
> Secondly, while printing in notepad from VB(excel) for instance -
> Print # 1 "Speed of car A ="; VarA
> It leaves a blank after = sign.
> Print results
>
> Speed of car A = 250
>
> Is there a way of printing the value of the variable without the
> space??
>
> Your help will be really appreciated.
>
> Thanks,
>
> Riggi
>


riggimehta

12/14/2006 6:43:00 PM

0

Thanks guys.... it really helped. I really appreciate.
NickHK wrote:
> Using
> "Speed of car A ="; VarA
> the ";" means print in the next column, the same as you see in the debug
> window.
> To control the output, build the string yourself :
> "Speed of car A =" & VarA
>
> NickHK
>
> <riggimehta@hotmail.com> wrote in message
> news:1165976709.088747.71750@j44g2000cwa.googlegroups.com...
> > Hi all,
> > Is there a way to print a number from excel sheet to notepad file and
> > not changing the format. For example when I try to print 78E-02 on the
> > notepad, it prints 0.78.
> >
> > Secondly, while printing in notepad from VB(excel) for instance -
> > Print # 1 "Speed of car A ="; VarA
> > It leaves a blank after = sign.
> > Print results
> >
> > Speed of car A = 250
> >
> > Is there a way of printing the value of the variable without the
> > space??
> >
> > Your help will be really appreciated.
> >
> > Thanks,
> >
> > Riggi
> >