![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Christchurch New Zealand
Posts: 1,030
|
I have a name
bruce mann total assigned to a variable How do I trim the total off the end of the variable? The variable is ever changing but will always have total at the end! _________________ [ This Message was edited by: brettvba on 2002-05-09 20:23 ] |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Mar 2002
Location: Sydney/Brisbane , Australia
Posts: 539
|
why dont you do a replace " total" with ""?
__________________
Colin |
|
|
|
|
|
#3 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Christchurch New Zealand
Posts: 1,030
|
yeah no i need to do it with code just for the one variable not the whole sheet..
|
|
|
|
|
|
#4 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: Auckland, New Zealand
Posts: 4,209
|
Quote:
How about: sNewVar = Left(sVar, InStr(1, sVar, "total") - 1) Where: sNewVar is the New string Variable sVar is you changing variable "total" is the string to remove. |
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|