Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
X axis captions Stefi Charts and Charting in Excel 6 September 11th 08 01:16 PM
Cell values as captions TUNGANA KURMA RAJU Excel Discussion (Misc queries) 1 July 24th 06 12:29 PM
clear captions from all labels Spencer Hutton[_4_] Excel Programming 3 November 20th 04 01:49 PM
reset menu captions T Excel Programming 2 November 12th 04 11:28 AM
Clear Textboxes, Labels, and Checkboxes milo[_2_] Excel Programming 1 October 16th 03 09:21 PM


All times are GMT +1. The time now is 11:09 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"