Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Converting Integers to text

I am having trouble converting an integer to text. I need to place a
leading zero next to the number when it is less than 10.

Trying to change this:
Print #1, "<html<titlepic" & i & "</title"
To this:
Print #1, "<html<titlepic" & TEXT(i,"00") & "</title"
does not work because the "TEXT" function is not a VBA function.

Any suggestions greatly appreciated.

Geoff
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 915
Default Converting Integers to text

Geoff E wrote:
I am having trouble converting an integer to text. I need to place a
leading zero next to the number when it is less than 10.

Trying to change this:
Print #1, "<html<titlepic" & i & "</title"
To this:
Print #1, "<html<titlepic" & TEXT(i,"00") & "</title"
does not work because the "TEXT" function is not a VBA function.

Any suggestions greatly appreciated.

Geoff


In VBA use Format(i,"00")
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Converting Integers to text

Thank you smartin.

Worked a treat.

Geoff


On Sep 7, 9:41*am, smartin wrote:
Geoff E wrote:
I am having trouble converting an integer to text. I need to place a
leading zero next to the number when it is less than 10.


Trying to change this:
Print #1, "<html<titlepic" & i & "</title"
To this:
Print #1, "<html<titlepic" & TEXT(i,"00") & "</title"
does not work because the "TEXT" function is not a VBA function.


Any suggestions greatly appreciated.


Geoff


In VBA use Format(i,"00")


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 915
Default Converting Integers to text

YW. Funny thing is, I often find myself trying to use Format() as a
worksheet function. Doesn't work (^:

Geoff E wrote:
Thank you smartin.

Worked a treat.

Geoff


On Sep 7, 9:41 am, smartin wrote:
Geoff E wrote:
I am having trouble converting an integer to text. I need to place a
leading zero next to the number when it is less than 10.
Trying to change this:
Print #1, "<html<titlepic" & i & "</title"
To this:
Print #1, "<html<titlepic" & TEXT(i,"00") & "</title"
does not work because the "TEXT" function is not a VBA function.
Any suggestions greatly appreciated.
Geoff

In VBA use Format(i,"00")


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
Stop Excel from converting integers into decimals (eg.; 12 to .12) mcwilljg Excel Discussion (Misc queries) 1 May 26th 07 03:58 AM
Stop Excel from converting integers into decimals? mcwilljg Setting up and Configuration of Excel 1 May 9th 07 07:20 PM
Converting a string to an array of integers DeathSurfer Excel Programming 4 March 21st 07 10:34 PM
A list of Consecutive Integers, can I search for missing integers CM Excel Worksheet Functions 4 September 2nd 05 06:38 PM
converting to Integers bmordhorst Excel Worksheet Functions 5 January 6th 05 04:55 PM


All times are GMT +1. The time now is 07:05 PM.

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"