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: 113
Default UserForm QueryClose

I have a fairly complex UserFrom called UF0_QCP and need to save it's data in
the workbook for which it was used (so that I can reinitialise later with the
last-used data. I have tried the following pair of subs but no msgbox from
either. What am I missing please (don't say the whole concept!)? Regards,
Brett


Private Sub UF0_QCP_QueryClose(Cancel As Integer, CloseMode As Integer)
MsgBox "QueryClose"
If CloseMode < 2 Then
Dim rw As Integer, cl As Integer
rw = Range("QCP.memory").Row + 1: cl = Range("QCP.memory").Column
For Each Control In UF0_QCP.Controls
On Error Resume Next
With Sheets("LAUNCHPAD")
.Cells(rw, cl) = Control.Name: .Cells(rw, cl + 2) =
Control.Caption: .Cells(rw, cl + 4) = Control.Value
.Cells(rw, cl + 6) = Control.Enabled: .Cells(rw, cl + 7) =
Control.Visible
.Cells(rw, cl + 8) = Control.Top: .Cells(rw, cl + 9) =
Control.Left
End With
rw = rw + 1: On Error GoTo 0
Next Control
Sheets("LAUNCHPAD").Range("QCP.memory") = True
End If
End Sub

AND FOR INITIALIZING;
Private Sub UF0_QCP_Initialize()
MsgBox "Initialize"
If Sheets("LAUNCHPAD").Range("QCP.memory") = True Then
Dim rw As Integer, cl As Integer
rw = Sheets("LAUNCHPAD").Range("QCP.memory").Row + 1: cl =
Sheets("LAUNCHPAD").Range("QCP.memory").Column
For Each Control In UF0_QCP.Controls
On Error Resume Next
With Sheets("LAUNCHPAD")
Control.Name = .Cells(rw, cl): Control.Caption =
..Cells(rw, cl + 2): Control.Value = .Cells(rw, cl + 4)
Control.Enabled = .Cells(rw, cl + 6): Control.Visible =
..Cells(rw, cl + 7)
Control.Top = .Cells(rw, cl + 8): Control.Left =
..Cells(rw, cl + 9)
End With
rw = rw + 1: On Error GoTo 0
Next Control
Sheets("LAUNCHPAD").Range("QCP.memory") = False
End If
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
QueryClose problem Keith74 Excel Programming 4 October 2nd 07 03:04 PM
Userform Queryclose and Unload problem Dave Ramage Excel Programming 3 March 8th 07 07:39 PM
Is there an easy Copy/Paste of a Userform ? (Entire Userform Including tx & cbx's) Corey Excel Programming 2 January 9th 07 01:01 PM
Looping procedure calls userform; how to exit loop (via userform button)? KR Excel Programming 6 July 27th 05 12:57 PM
Activating userform and filling it with data form row where userform is activate Marthijn Beusekom via OfficeKB.com[_2_] Excel Programming 3 May 6th 05 05:44 PM


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