Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default =Right Function

Hi All

Can any one tell me what this means:

= Right((Cells(2, 2)), 4)

In a cell where the contents are a date lets say
11/06/2004, I'd like to get the year from the date.

Can you help?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default =Right Function

What you have is vba
range("a1")= Right((Cells(2, 2)), 4)
to use a formula, just use
=year(b2)
and format as text or number without the comma


--
Don Guillett
SalesAid Software

"Sanj" wrote in message
...
Hi All

Can any one tell me what this means:

= Right((Cells(2, 2)), 4)

In a cell where the contents are a date lets say
11/06/2004, I'd like to get the year from the date.

Can you help?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default =Right Function

Hi
this gets the 4 rightmost characters of cell B2. But this
won't give you the expected result in B2 contains a date
(as Excel stores dates internally as numbers). To get the
year in VBA try:
msgbox Year(activesheet.cells(2,2).value)

-----Original Message-----
Hi All

Can any one tell me what this means:

= Right((Cells(2, 2)), 4)

In a cell where the contents are a date lets say
11/06/2004, I'd like to get the year from the date.

Can you help?
.

  #4   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default =Right Function

that work brilliantly, now I need to add that year
automatically to a graph title

can you help?


-----Original Message-----
What you have is vba
range("a1")= Right((Cells(2, 2)), 4)
to use a formula, just use
=year(b2)
and format as text or number without the comma


--
Don Guillett
SalesAid Software

"Sanj" wrote in message
...
Hi All

Can any one tell me what this means:

= Right((Cells(2, 2)), 4)

In a cell where the contents are a date lets say
11/06/2004, I'd like to get the year from the date.

Can you help?



.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default =Right Function

Hi
try the following
- select your graph
- select the title textbox
- hit F2
- enter the equation sign '='
- now select with yoour mouse the source cell and hit ENTER

-----Original Message-----
that work brilliantly, now I need to add that year
automatically to a graph title

can you help?


-----Original Message-----
What you have is vba
range("a1")= Right((Cells(2, 2)), 4)
to use a formula, just use
=year(b2)
and format as text or number without the comma


--
Don Guillett
SalesAid Software

"Sanj" wrote in message
.. .
Hi All

Can any one tell me what this means:

= Right((Cells(2, 2)), 4)

In a cell where the contents are a date lets say
11/06/2004, I'd like to get the year from the date.

Can you help?



.

.

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
copy of excel file not showing formulal/function in the function b oaallam Excel Discussion (Misc queries) 4 September 6th 07 01:20 PM
LINKEDRANGE function - a complement to the PULL function (for getting values from a closed workbook) [email protected] Excel Worksheet Functions 0 September 5th 06 03:44 PM
Offset function with nested match function not finding host ss. MKunert Excel Worksheet Functions 1 March 21st 06 10:46 PM
Adding a custom function to the default excel function list DonutDel Excel Programming 3 November 21st 03 03:41 PM
User-Defined Function pre-empting Built-in Function? How to undo???? MarWun Excel Programming 1 August 6th 03 09:31 PM


All times are GMT +1. The time now is 02:16 PM.

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"