LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 124
Default Year as text

To eliminate the space with the least hassle:

lastYear = Format$(ThisYear - 1)



On Thu, 7 Aug 2003 07:01:03 -0700, "ten" wrote:

Hi,
I have some year as integer I need to use as a text-
string. For instance I have the two variables thisYear and
lastYear, the latter calculated as lastYear = thisYear -1.

I need to do some string-excercises on these. However,
since I am using integer-calculation, Excel sees the
lastYear variable as a number.

I tried to do it with the Str() method:
lastYear = Str(thisYear - 1)
However, then I got a space in front: " 2002".

1) Are there better solutions?
2) How can I trim the space before the year away?

Thx!


 
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
Enter month and year as text Orrie[_2_] New Users to Excel 6 February 16th 09 05:56 PM
Summing on year and text conditions Dave_in_gva Excel Worksheet Functions 6 December 19th 08 04:46 PM
Pulling Year from a text string Elkar Excel Worksheet Functions 0 February 20th 07 06:33 PM
Year as text Harald Staff[_4_] Excel Programming 0 August 7th 03 06:36 PM
Year as text Shunt Excel Programming 1 August 7th 03 03:22 PM


All times are GMT +1. The time now is 09:57 AM.

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

About Us

"It's about Microsoft Excel"