Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
antonsaitz
 
Posts: n/a
Default Problem with control tag and populating speadsheet


Hi,

I've got what appears to be an issue with the syntax for userform
control properties. It is probably a simple issue but I've tried
various ways of making it work to no avail. I keep getting errror
values for With my program to place values on a speadsheet based on the
control tag properties and offset function. I keep getting an error when
I try to set a variable to the range specified by the control tag.

Here is the whole code for populating the speadsheet and feeding back
to a validation page on the userform.

If anyone can please help me with this problem I would be greatly
appreciated!

Thank you,
Matt


Code:
--------------------
Private Sub CmdOK2_Click()

Sheet2.Select
Range("A1").End(xlDown).Select
LastFilledRowinRange = ActiveCell.Row


Dim Ctrl As Control
Dim Desticells As Range
Dim Sourcecells As Range

For N = 0 To 1
For Each Ctrl In Me.MultiPage1.Pages(N).Controls

If Ctrl.Tag < "" Then
If Ctrl.Value < False Then

Set Desticells = Range(Ctrl.Tag) 'Range 'global failed error

Desticells.Offset(LastFilledRowinRange, 0) = Desticells
If Ctrl.Value = True Then Range(Desticells).Value = Ctrl.TabIndex
If Ctrl.Value < False Or "" Then Range(Desticells).Text = Ctrl.Text
End If

End If
Next Ctrl
Next N

For Each Ctrl In Me.MultiPage1.Pages(2).Controls

If Ctrl.Tag < "" Then
Set Soucecells = Range(Ctrl.Tag)
Sourcecells.Offset(LastFilledRowinRange, 0) = Sourcecells
Range(Sourcecells).Text = Ctrl.Text
End If
Next Ctrl


Call Next_Button

End Sub
--------------------


--
antonsaitz
------------------------------------------------------------------------
antonsaitz's Profile: http://www.excelforum.com/member.php...o&userid=35915
View this thread: http://www.excelforum.com/showthread...hreadid=557376

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



All times are GMT +1. The time now is 05:42 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"