ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Cell value equals last four charecters (https://www.excelbanter.com/excel-discussion-misc-queries/86832-cell-value-equals-last-four-charecters.html)

mohd21uk via OfficeKB.com

Cell value equals last four charecters
 
I am using a macro to validate a form. I would like cell A1 to equate to the
last four charecters of cell a4. For e.g if cell a1 is 552004k00 cell a4
should have the value 4k00. I would be grateful if you could provide this to
me in VBA code.

Thanks

--
Message posted via http://www.officekb.com

Ardus Petus

Cell value equals last four charecters
 
range("A1").value = right(Range("A1").Value,4)

HTH
--
AP

"mohd21uk via OfficeKB.com" <u20517@uwe a écrit dans le message de news:
5fc10ccb33c8b@uwe...
I am using a macro to validate a form. I would like cell A1 to equate to
the
last four charecters of cell a4. For e.g if cell a1 is 552004k00 cell a4
should have the value 4k00. I would be grateful if you could provide this
to
me in VBA code.

Thanks

--
Message posted via http://www.officekb.com




Gary''s Student

Cell value equals last four charecters
 
Try:

Range("A4").Value = Right(Range("A1").Value, 4)
--
Gary's Student


"mohd21uk via OfficeKB.com" wrote:

I am using a macro to validate a form. I would like cell A1 to equate to the
last four charecters of cell a4. For e.g if cell a1 is 552004k00 cell a4
should have the value 4k00. I would be grateful if you could provide this to
me in VBA code.

Thanks

--
Message posted via http://www.officekb.com



All times are GMT +1. The time now is 02:40 AM.

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