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: 921
Default Date subtraction question

I am trying to create a little vba macro that calculates the number of the
month as well as the name of the month for use later in calculations. I
havethe following:
XLMonth = Month(Date)
XlMonth2 = Format(Date, "mmm")


So I figure I can if/then statement the whole thing, but it is the "else"
part that I am having trouble with. I need to move back a month (-1) if a
condition set earlier is met. But when I subtract (-1) from XlMonth I get
zero and noth 12. How do I work around this.
 
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
Subtraction Question kinderteacher101 Excel Discussion (Misc queries) 2 November 1st 09 10:18 PM
Excel subtraction question Dig Excel Discussion (Misc queries) 4 December 11th 07 01:04 PM
Newbie Question - Subtraction Formula Question [email protected] Excel Discussion (Misc queries) 3 May 5th 06 05:50 PM
Subtraction question Richard Excel Discussion (Misc queries) 6 May 22nd 05 12:57 PM
Subtraction Question Richard Excel Discussion (Misc queries) 6 May 22nd 05 01:54 AM


All times are GMT +1. The time now is 02:03 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"