Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Clear Captions from labels
i posted a question last night about this and the answer was not as
effective as i would have liked. i have a sheet with ove 100 labels on it and i am trying to clear all of their captions wih a loop. someone gave me this code: Dim shp As Shape For Each shp In ActiveSheet.Shapes If shp.Type = msoFormControl Then If shp.FormControlType = xlLabel Then shp.TextFrame.Characters.Text = "" End If End If Next which did not do what i expected. can anyone offer anything further? see post on 11/20 @ 12:00 AM Thank you. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Clear Captions from labels
which did not do what i expected Don't get me wrong but when you say something like this it does no help anyone help you as they don't understand what you mean. The solution as presented - did it work or did it not, and if not ca you explain what went wrong. I have a feeling it did do what you wanted it to do (which is clear th labels) but it did more than what you thought it would, therefor disrupting your spreadsheet, rather than just clearing what yo actually wanted to specify. Or did you really mean - Remove the labels - which is not the same a clearing. Sorry about the questions but you must be more specific when sayin that it doesn't do what you want....no one is a mind reader and we ar not in your head.... regards Sea -- smcpolan ----------------------------------------------------------------------- smcpoland's Profile: http://www.excelforum.com/member.php...fo&userid=1669 View this thread: http://www.excelforum.com/showthread.php?threadid=31899 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Clear Captions from labels
I understand what you mean now that i am reading what i posted. what i
meant by "not what i expected" is that it did not clear the captions from the labels. i didn't want to remove the labels from my worksheet, i just wanted their captions to be blank, so that they could later be filled/changed by the outcome of a formula / code. thank you. "smcpoland" wrote in message ... which did not do what i expected Don't get me wrong but when you say something like this it does not help anyone help you as they don't understand what you mean. The solution as presented - did it work or did it not, and if not can you explain what went wrong. I have a feeling it did do what you wanted it to do (which is clear the labels) but it did more than what you thought it would, therefore disrupting your spreadsheet, rather than just clearing what you actually wanted to specify. Or did you really mean - Remove the labels - which is not the same as clearing. Sorry about the questions but you must be more specific when saying that it doesn't do what you want....no one is a mind reader and we are not in your head.... regards Sean -- smcpoland ------------------------------------------------------------------------ smcpoland's Profile: http://www.excelforum.com/member.php...o&userid=16693 View this thread: http://www.excelforum.com/showthread...hreadid=318998 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Clear Captions from labels
it is not a label from the Forms toolbar, it is from the Control Toolbox.
when i tried this code with the Forms type of label, the code worked. How can i make it work with the other type of label. what is the difference? "smcpoland" wrote in message ... which did not do what i expected Don't get me wrong but when you say something like this it does not help anyone help you as they don't understand what you mean. The solution as presented - did it work or did it not, and if not can you explain what went wrong. I have a feeling it did do what you wanted it to do (which is clear the labels) but it did more than what you thought it would, therefore disrupting your spreadsheet, rather than just clearing what you actually wanted to specify. Or did you really mean - Remove the labels - which is not the same as clearing. Sorry about the questions but you must be more specific when saying that it doesn't do what you want....no one is a mind reader and we are not in your head.... regards Sean -- smcpoland ------------------------------------------------------------------------ smcpoland's Profile: http://www.excelforum.com/member.php...o&userid=16693 View this thread: http://www.excelforum.com/showthread...hreadid=318998 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Clear Captions from labels
Sub ClearLabels()
Dim i As Long For i = 1 To ActiveSheet.OLEObjects.Count If TypeName(ActiveSheet.OLEObjects(i).Object) = "Label" Then ActiveSheet.OLEObjects(i).Object.Caption = "" End If Next i End Sub -- HTH RP (remove nothere from the email address if mailing direct) "Spencer Hutton" wrote in message om... i posted a question last night about this and the answer was not as effective as i would have liked. i have a sheet with ove 100 labels on it and i am trying to clear all of their captions wih a loop. someone gave me this code: Dim shp As Shape For Each shp In ActiveSheet.Shapes If shp.Type = msoFormControl Then If shp.FormControlType = xlLabel Then shp.TextFrame.Characters.Text = "" End If End If Next which did not do what i expected. can anyone offer anything further? see post on 11/20 @ 12:00 AM Thank you. |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Clear Captions from labels
Sorry Spencer - I didn't realise you were using the Control Toolbox.
I'd give you another solution but Bob (and others?) have an supplied excellent solution already. -- Rob van Gelder - http://www.vangelder.co.nz/excel "Spencer Hutton" wrote in message om... i posted a question last night about this and the answer was not as effective as i would have liked. i have a sheet with ove 100 labels on it and i am trying to clear all of their captions wih a loop. someone gave me this code: Dim shp As Shape For Each shp In ActiveSheet.Shapes If shp.Type = msoFormControl Then If shp.FormControlType = xlLabel Then shp.TextFrame.Characters.Text = "" End If End If Next which did not do what i expected. can anyone offer anything further? see post on 11/20 @ 12:00 AM Thank you. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
X axis captions | Charts and Charting in Excel | |||
Cell values as captions | Excel Discussion (Misc queries) | |||
clear captions from all labels | Excel Programming | |||
reset menu captions | Excel Programming | |||
Clear Textboxes, Labels, and Checkboxes | Excel Programming |