View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Casey[_65_] Casey[_65_] is offline
external usenet poster
 
Posts: 1
Default Naming command buttons on a UserForm


Hi,
I have a UserForm named UFListSelector. On it are 8 command buttons
that I want the names to be the value of the range of cells A1:H1 on
sheet RoomItems. I'm getting a run-time error 13
type mismatched error.

Here is the Code:

Option Explicit
Private Sub cmdShowItemSelect_Click()
Dim i As Integer

UFListSelector.RefEdit1.Value = ActiveCell.Address
For i = 1 To 8
UFListSelector.Controls("CommandButton" & i).Caption = _
ActiveWorkbook.Sheets("RoomItems").Range(Columns(i ) & "1").Value
Next i

UFListSelector.Show
End Sub


--
Casey


------------------------------------------------------------------------
Casey's Profile: http://www.excelforum.com/member.php...fo&userid=4545
View this thread: http://www.excelforum.com/showthread...hreadid=530958