ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   New to me (https://www.excelbanter.com/excel-programming/358323-new-me.html)

Striker

New to me
 
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?



Tom Ogilvy

New to me
 
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?




Bob Phillips[_6_]

New to me
 


"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



Ron de Bruin

New to me
 
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?




Striker

New to me
 
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?




Bob Phillips[_6_]

New to me
 
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?







All times are GMT +1. The time now is 11:05 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com