ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   =Right Function (https://www.excelbanter.com/excel-programming/301173-%3Dright-function.html)

Sanj

=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?

Don Guillett[_4_]

=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?




Frank Kabel

=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?
.


No Name

=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?



.


Frank Kabel

=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?



.

.



All times are GMT +1. The time now is 11:33 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com