Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help a Newby Please!!
Hi,
This way be very simple, but I need a code that will delete the part of a text in a cell. For example I have a cell that contains the following "ZZ112: *:XYZ " I want to get ride of the anything before the star and any spaces after the Z. I remember something about cutting up strings back from my serious VB days, but I can't seem to remember how to do it. Thanks a lot |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help a Newby Please!!
This should do it
Sub deletetext() For Each c In Selection c.Value = Trim(Right(c, Len(c) - InStr(c, "*"))) Next End Sub -- Don Guillett SalesAid Software "Frenchie" wrote in message om... Hi, This way be very simple, but I need a code that will delete the part of a text in a cell. For example I have a cell that contains the following "ZZ112: *:XYZ " I want to get ride of the anything before the star and any spaces after the Z. I remember something about cutting up strings back from my serious VB days, but I can't seem to remember how to do it. Thanks a lot |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help a Newby Please!!
Thanks
"Don Guillett" wrote in message ... This should do it Sub deletetext() For Each c In Selection c.Value = Trim(Right(c, Len(c) - InStr(c, "*"))) Next End Sub -- Don Guillett SalesAid Software "Frenchie" wrote in message om... Hi, This way be very simple, but I need a code that will delete the part of a text in a cell. For example I have a cell that contains the following "ZZ112: *:XYZ " I want to get ride of the anything before the star and any spaces after the Z. I remember something about cutting up strings back from my serious VB days, but I can't seem to remember how to do it. Thanks a lot |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help a Newby Please!!
The command you wrote is way over my head even with the VBA help :)
Do you mind explaining what each part actualy does please so that I am not just dumbly using someone elses code but understanding what I am doing. Many Thanks "Don Guillett" wrote in message ... This should do it Sub deletetext() For Each c In Selection c.Value = Trim(Right(c, Len(c) - InStr(c, "*"))) Next End Sub -- Don Guillett SalesAid Software "Frenchie" wrote in message om... Hi, This way be very simple, but I need a code that will delete the part of a text in a cell. For example I have a cell that contains the following "ZZ112: *:XYZ " I want to get ride of the anything before the star and any spaces after the Z. I remember something about cutting up strings back from my serious VB days, but I can't seem to remember how to do it. Thanks a lot |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help a Newby Please!!
Thanks alot
"Don Guillett" wrote in message ... A look in VBA help for each of the segments would help. An easy way to do this is to highlight the word such as instr and then touch the f1 key. Instr looks for where in the string the value occurs and gives a number. len gives the entire length of the string. and trim trims it. c could have been x or mycell or joesbar or whatever you desired. -- Don Guillett SalesAid Software "Frenchie" wrote in message om... The command you wrote is way over my head even with the VBA help :) Do you mind explaining what each part actualy does please so that I am not just dumbly using someone elses code but understanding what I am doing. Many Thanks "Don Guillett" wrote in message ... This should do it Sub deletetext() For Each c In Selection c.Value = Trim(Right(c, Len(c) - InStr(c, "*"))) Next End Sub -- Don Guillett SalesAid Software "Frenchie" wrote in message om... Hi, This way be very simple, but I need a code that will delete the part of a text in a cell. For example I have a cell that contains the following "ZZ112: *:XYZ " I want to get ride of the anything before the star and any spaces after the Z. I remember something about cutting up strings back from my serious VB days, but I can't seem to remember how to do it. Thanks a lot |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Break Apart a Cell, please help a newby | Excel Discussion (Misc queries) | |||
Newby questions - simple (I hope) | Excel Discussion (Misc queries) | |||
Newby help | Excel Worksheet Functions | |||
Another Newby question about selecting and what it can do [longish] | Excel Programming | |||
Yet another Newby question about selecting | Excel Programming |