You have to make a loop through each OleObject Embaded on Worksheet, 

See if it helps.

Sub LoopWsCntrl()

Dim OLECont As OLEObject

Dim lRow As Long, lCol As Long

 

    For Each OLECont In Sheet1.OLEObjects

        If OLECont.progID = "Forms.TextBox.1" Then

      Variable = OLECont.Object.Value

        End If

     Next OLECont

End Sub

 

From: excel-macros@googlegroups.com [mailto:excel-macros@googlegroups.com]
On Behalf Of shariq khan
Sent: Friday, July 08, 2011 2:30 PM
To: excel-macros@googlegroups.com
Subject: $$Excel-Macros$$ Need Help Help Help.....Putting value in user from
by loop

 

I'm trying to assign the value in excel user from thought loop.

 

Name of the textboxes are TB1,TB2,TB3.... TB22  .

 

Below is the code which I'm using ,but its not working. 

 

For num = 1 To 22

        txtbox_val = "TB" & num & ".value"

            txtbox_val = num

        End If

  Next num

 

 

The same thing I wanted to do with the label and the names of the label are
L1,L2,L3..L22

 

Please help me on this.

 

  



-- 
Thanks and Reagrd's
Shariq


 

-- 
----------------------------------------------------------------------------
------
Some important links for excel users:
1. Follow us on TWITTER for tips tricks and links :
http://twitter.com/exceldailytip
2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310
3. Excel tutorials at http://www.excel-macros.blogspot.com
4. Learn VBA Macros at http://www.quickvba.blogspot.com
5. Excel Tips and Tricks at http://exceldailytip.blogspot.com

To post to this group, send email to excel-macros@googlegroups.com
 
<><><><><><><><><><><><><><><><><><><><><><>
Like our page on facebook , Just follow below link
http://www.facebook.com/discussexcel

-- 
----------------------------------------------------------------------------------
Some important links for excel users:
1. Follow us on TWITTER for tips tricks and links : 
http://twitter.com/exceldailytip
2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310
3. Excel tutorials at http://www.excel-macros.blogspot.com
4. Learn VBA Macros at http://www.quickvba.blogspot.com
5. Excel Tips and Tricks at http://exceldailytip.blogspot.com
 
To post to this group, send email to excel-macros@googlegroups.com

<><><><><><><><><><><><><><><><><><><><><><>
Like our page on facebook , Just follow below link
http://www.facebook.com/discussexcel

Reply via email to