View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
ryan ryan is offline
external usenet poster
 
Posts: 46
Default Populate Userform from another workbook

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)").Activat
Unload UserForm12FLATDIPSAppraisa
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.Sho
End Su

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