Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am kind of new to VBA. I picked up a book and will try to figure it all
out. In reading through some of the posts, this board looks like a good place to ask questions. Please let me know if there is a better one. Question. In Excel 2002, I want to load a form that copies text data from a row of cells into a form. So my first question is how do I load the form I created? What I did is add a module with one sub that just loads the form into memory, like below.... Sub LoadForm() Range("A2").Select Load frmMain End Sub Then I was thinking about putting code to copy cells of data into text boxes using the offset method from "A2" in the Form Initialize event. I want the user to manually start the form, so am I on the correct track with where I'm going? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub LoadForm()
Range("A2").Select frmMain.Show End Sub would load and show the form. It sounds like you are going in the right direction. -- Regards, Tom Ogilvy "Striker" wrote: I am kind of new to VBA. I picked up a book and will try to figure it all out. In reading through some of the posts, this board looks like a good place to ask questions. Please let me know if there is a better one. Question. In Excel 2002, I want to load a form that copies text data from a row of cells into a form. So my first question is how do I load the form I created? What I did is add a module with one sub that just loads the form into memory, like below.... Sub LoadForm() Range("A2").Select Load frmMain End Sub Then I was thinking about putting code to copy cells of data into text boxes using the offset method from "A2" in the Form Initialize event. I want the user to manually start the form, so am I on the correct track with where I'm going? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() "Striker" wrote in message ... I am kind of new to VBA. I picked up a book and will try to figure it all out. In reading through some of the posts, this board looks like a good place to ask questions. Please let me know if there is a better one. Oh yeah, the one across the road is much better, that is why we are all here. No, this is the best. No ifs, no buts, the best. You get Tom Ogilvy here, occasionally Rob Bovey and Stephen Bullen, Harlan Grove checks in occasionally, Ron de Bruin, Dave Peterson, Norman Jones, Jim Cone, Papou, Michael Pierron, Chip Pearson, KJon Peltire, Jan Karel Pieterse,... It doesn't get an y better than this Question. In Excel 2002, I want to load a form that copies text data from a row of cells into a form. So my first question is how do I load the form I created? What I did is add a module with one sub that just loads the form into memory, like below.... Sub LoadForm() Range("A2").Select Load frmMain End Sub Sub LoadForm() Load frmMain With frmMain .Textbox1.Text = Range("A2").Text .Textbox2.Text = Range("A2").Offest(1,0).Text .Textbox3.Text = Range("A2").Offest(2,0).Text 'etc. .Show End With End Sub |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Striker
See this KB http://support.microsoft.com/default...b;EN-US;829070 -- Regards Ron de Bruin http://www.rondebruin.nl "Striker" wrote in message ... I am kind of new to VBA. I picked up a book and will try to figure it all out. In reading through some of the posts, this board looks like a good place to ask questions. Please let me know if there is a better one. Question. In Excel 2002, I want to load a form that copies text data from a row of cells into a form. So my first question is how do I load the form I created? What I did is add a module with one sub that just loads the form into memory, like below.... Sub LoadForm() Range("A2").Select Load frmMain End Sub Then I was thinking about putting code to copy cells of data into text boxes using the offset method from "A2" in the Form Initialize event. I want the user to manually start the form, so am I on the correct track with where I'm going? |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
WOW great response. OK now I am putting a command button to move to the
next row and put text from that row into the test boxes. I think I can use the offset method to do this, but I need to be careful in case someone has changes the text in the form, I need to copy to the spreadsheet. From reading thru this forum I was thinking about setting a variable (bool) to make the form dirty. Perhaps bDirty as booleen. Would this be a global variable in the module, or could it be a global variable in the form? "Striker" wrote in message ... I am kind of new to VBA. I picked up a book and will try to figure it all out. In reading through some of the posts, this board looks like a good place to ask questions. Please let me know if there is a better one. Question. In Excel 2002, I want to load a form that copies text data from a row of cells into a form. So my first question is how do I load the form I created? What I did is add a module with one sub that just loads the form into memory, like below.... Sub LoadForm() Range("A2").Select Load frmMain End Sub Then I was thinking about putting code to copy cells of data into text boxes using the offset method from "A2" in the Form Initialize event. I want the user to manually start the form, so am I on the correct track with where I'm going? |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Probably best in the module, a standard module, not a worksheet module.
-- HTH Bob Phillips (remove nothere from email address if mailing direct) "Striker" wrote in message ... WOW great response. OK now I am putting a command button to move to the next row and put text from that row into the test boxes. I think I can use the offset method to do this, but I need to be careful in case someone has changes the text in the form, I need to copy to the spreadsheet. From reading thru this forum I was thinking about setting a variable (bool) to make the form dirty. Perhaps bDirty as booleen. Would this be a global variable in the module, or could it be a global variable in the form? "Striker" wrote in message ... I am kind of new to VBA. I picked up a book and will try to figure it all out. In reading through some of the posts, this board looks like a good place to ask questions. Please let me know if there is a better one. Question. In Excel 2002, I want to load a form that copies text data from a row of cells into a form. So my first question is how do I load the form I created? What I did is add a module with one sub that just loads the form into memory, like below.... Sub LoadForm() Range("A2").Select Load frmMain End Sub Then I was thinking about putting code to copy cells of data into text boxes using the offset method from "A2" in the Form Initialize event. I want the user to manually start the form, so am I on the correct track with where I'm going? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|