Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Userform Question Posted Again

if the buttons are in the second workbook, then you can't refer to the
userform in the first workbook from the code in the second workbook.

It is possible, but you have to call code in the first workbook that passes
a reference to the userform to the second workbook using a function.

It is unclear why you would go to a second workbook and click a button to
select what is populated in the userform. the normal way would be to have a
combobox in the userform that lists company names, then when one is
selected, code in the userform would gather the data from the second
workbook.

--
Regards,
Tom Ogilvy



"Ryan" wrote in message
...
On my userform, there is a command button that goes to a worksheet in

another workbook. This new worksheet serves as a sort of database for
companies. Each company is listed in a row with a commandbutton to the left
of the company information that will populate the userform from the first
workbook. I am having problem with my code for this action:

Private Sub CommandButton1_Click()
Workbooks("Workflow Engine").Worksheets("FLAT DIP(S)").Activate
Unload UserForm12FLATDIPSAppraisal
UserForm12FLATDIPSAppraisal.TextBox2.Text = Workbooks("CARDEX

TEST").Sheets("AppraisalCardex").Range("C3")
UserForm12FLATDIPSAppraisal.TextBox3.Text = Workbooks("CARDEX

TEST").Sheets("AppraisalCardex").Range("D3")
UserForm12FLATDIPSAppraisal.TextBox4.Text = Workbooks("CARDEX

TEST").Sheets("AppraisalCardex").Range("F3")
UserForm12FLATDIPSAppraisal.TextBox5.Text = Workbooks("CARDEX

TEST").Sheets("AppraisalCardex").Range("E3")
UserForm12FLATDIPSAppraisal.TextBox6.Text = Workbooks("CARDEX

TEST").Sheets("AppraisalCardex").Range("B3")
UserForm12FLATDIPSAppraisal.Show
End Sub

The problem occurs when I Unload the Userform. I have exhausted my

knowledge of VBA (which took all of 30 sec.) and I can't figure out how to
fix this problem.
I had this working perfectly when the database of companies was part of

the original workbook. My boss decided that he wanted the users to have the
appearance of not leaving the screen, so that is why I am trying to use this
other workbook. Another question that I have is can you set the size of a
window in VBA? Because I would like to be able to set how big the database
workbook is so that users feel like they never left the original workbook
screen.

Ryan



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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Question not posted? Simon New Users to Excel 4 May 5th 10 05:50 PM
How do I find a question I posted yesterday? englishrose4719 Excel Discussion (Misc queries) 5 October 21st 09 02:05 PM
Please can someone look at question i posted yesterday jimE Excel Worksheet Functions 2 October 23rd 07 10:27 PM
How do I get back to a question I've posted? Jim Excel Discussion (Misc queries) 2 June 6th 07 04:24 PM
How do I find a question I posted last week? englishrose4719 Excel Discussion (Misc queries) 3 May 16th 07 12:28 PM


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