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: 683
Default Referencing User Form from WorkBook

I have a User Form that once it is filled in, it updates several other Work
Books from different Control Buttons.

I need to save the Input on the User Form in one of the Wook Books, so that
if the Work Book is opened again the User Form automatically Fills back in.
I have the following code for when my Work Book is opened:

' Open Existing Eng Spec 9 Control Button
Private Sub Open_Existing_Eng_Spec_9_Click()

Dim FileToOpen As Variant
Dim bk As Workbook
Dim LastBackSlashPos As Long
Dim myMsg As String

FileToOpen = Application.GetOpenFilename("SPEC (*.xlsm), Spec*.xlsm")

If FileToOpen = False Then

MsgBox prompt:=Engineering_2.Value & vbLf & "You canceled opening an
Engineering Spec", _
Title:="C.E.S."

' MsgBox "User Canceled Operation, No Engineering Spec was Opened",
, "C.E.S."
Exit Sub
End If

LastBackSlashPos = InStrRev(FileToOpen, "\", -1, vbTextCompare)

If UCase(Mid(FileToOpen, LastBackSlashPos + 1, 4)) < UCase("SPEC") Then

MsgBox prompt:=Engineer_2.Value & vbLf & "You can only open an
exsisting Engineering Spec", _
Title:="C.E.S."

Exit Sub
End If

Set bk = Workbooks.Open(Filename:=FileToOpen)
'================================================= ====
'Update Data Storage Sheet (Hidden in Job Work Book)
'================================================= ====

With Workbooks("Master Engineering Spec.xlsm").Sheets("COVER SHEET")
' Site Information:
Me("CLLI_Code_1").Value = .Range("D02").Value
Me("Office_1").Value = .Range("D03").Value
Me("Address_11").Value = .Range("D04").Value
Me("Address_12").Value = .Range("D05").Value

More Code like above here

' Line 46
Me("Type_Work_723").Value = .Range("C83").Value
Me("Bay_Description_723").Value = .Range("J83").Value
Me("Bay_ID_723").Value = .Range("F83").Value
Me("Description_Work_723").Value = .Range("M83").Value
'================================================= ====

End Sub


How would I reference the User Form from the Work Book so that when the Work
Book is opened the Data from the hidden Sheet is automaticaly sent back to
the User Form to fill it back in?

User Form = UserForm1
Work Book = Master Engineering Spec.xlsm
Sheet = Job Data
 
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
Workbook does not Save from User Form Brian Excel Programming 6 January 5th 10 03:06 AM
Can I use VBA to copy User Form from 1 workbook to another? MikeZz Excel Programming 29 September 24th 09 11:36 PM
Active Workbook from User Form Troubled User Excel Programming 1 September 2nd 09 03:08 AM
Filling/referencing cells from User Form Xhawk57 Excel Programming 0 November 12th 08 07:08 PM
Date field in user form & Loading a user form on opening workbook Balan Excel Programming 1 May 24th 08 03:40 PM


All times are GMT +1. The time now is 06:59 AM.

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"