LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 80
Default changing activesheet shapes label caption

Hi All,
I have following code but it doess not work.Basically I try to change
the captions in a loop.Any help?
Thank you very much in advance
baha
sub givingnames
Dim i As Variant
Dim a As Variant
a = Sheet4.Range("AT39").Value

For i = 1 To 10
On Error Resume Next
ActiveSheet.Shapes("Image" & i).OLEFormat.Object.Object.Picture = _
LoadPicture(ThisWorkbook.Path & "\Pictures\" & a & ".BMP")
ActiveSheet.Shapes("LabelA" & i).Caption =
Application.WorksheetFunction.VLookup((a),
Sheets("DataPage").Range("dataA"), 2, 0) ' & _
'vbCrLf & "TempCard: " & Application.WorksheetFunction.VLookup(i + k +
alt - 1, Sheets("DataPage").Range("dataA"), 4, 0)

a = a + 1
If Dir(ThisWorkbook.Path & "\Pictures\" & i & ".BMP") = "" Then
ActiveSheet.Shapes("Image" & i).OLEFormat.Object.Object.Picture = _
LoadPicture(ThisWorkbook.Path & "\Pictures\nopic.BMP")
End If
Next i
end sub

 
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
changing label caption by user input juliejg1 Excel Programming 2 April 10th 06 10:01 PM
Changing label caption in a Userform to an opterator value jumpjump Excel Programming 2 August 25th 05 01:50 AM
Label - Caption not changing Brian Hribek[_2_] Excel Programming 0 October 11th 04 10:02 PM
Label - Caption not changing Brian Hribek Excel Programming 1 October 11th 04 09:19 PM
changing the caption of a label Koos Excel Programming 4 October 18th 03 02:36 PM


All times are GMT +1. The time now is 09:38 PM.

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

About Us

"It's about Microsoft Excel"