Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Problem with Userform

Thanks for the help - i created a userform, using a sample downloaded
from the internet, to populate 2 lists. This is the code

Option Explicit

Private Sub CmdAddInt_Click()
Dim iRow As Long
Dim ws As Worksheet
Set ws = Worksheets("Resources")

'find first empty row in database
iRow = ws.Cells(Rows.Count, 1) _
.End(xlUp).Offset(1, 0).Row

'copy the data to the database
ws.Cells(iRow, 1).Value = Me.NameInt.Value
ws.Cells(iRow, 2).Value = Me.CompInt.Value


'clear the data
Me.NameInt.Value = ""
Me.CompInt.Value = ""
'Me.NameInt.SetFocus

Unload Me

End Sub

This routine does not work - in come cases the entry form will not
display any text as i enter it and it will not copy the entered text
into the specified worksheet. The routine shown below appears to my
untrained eyes to be identical and it does exactly what i want it to
do. Can some one help me figure out why one works but not the other.
The are contained within a multipage userform. In addtion i am
interested in learning how to program within excel - i have
significant experience in using excel but no programming experience -
can someone suggest the best way to learn programming excel vba

Thanks for your help



Private Sub CmdAddEx_Click()
Dim eRow As Long
Dim ws As Worksheet
Set ws = Worksheets("Resources Ext")

'find first empty row in database
eRow = ws.Cells(Rows.Count, 1) _
.End(xlUp).Offset(1, 0).Row

'copy the data to the database
ws.Cells(eRow, 1).Value = Me.NameExt.Value
ws.Cells(eRow, 2).Value = Me.CompExt.Value


'clear the data
Me.NameExt.Value = ""
Me.CompExt.Value = ""
Me.NameExt.SetFocus

Unload Me

End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Problem with Userform

I have figured out my problem with the userform - i would still like
some advice on the best way to learn the excel vba programming

Thanks

On Jan 2, 12:11*pm, vitorjose wrote:
Thanks for the help - i created a userform, using a sample downloaded
from the internet, to populate 2 lists. *This is the code

Option Explicit

Private Sub CmdAddInt_Click()
Dim iRow As Long
Dim ws As Worksheet
Set ws = Worksheets("Resources")

'find *first empty row in database
iRow = ws.Cells(Rows.Count, 1) _
* .End(xlUp).Offset(1, 0).Row

'copy the data to the database
ws.Cells(iRow, 1).Value = Me.NameInt.Value
ws.Cells(iRow, 2).Value = Me.CompInt.Value

'clear the data
Me.NameInt.Value = ""
Me.CompInt.Value = ""
'Me.NameInt.SetFocus

Unload Me

End Sub

This routine does not work - in come cases the entry form will not
display any text as i enter it and it will not copy the entered text
into the specified worksheet. *The routine shown below appears to my
untrained eyes to be identical and it does exactly what i want it to
do. *Can some one help me figure out why one works but not the other.
The are contained within a multipage userform. *In addtion i am
interested in learning how to program within excel - i have
significant experience in using excel but no programming experience -
can someone suggest the best way to learn programming excel vba

Thanks for your help

Private Sub CmdAddEx_Click()
Dim eRow As Long
Dim ws As Worksheet
Set ws = Worksheets("Resources Ext")

'find *first empty row in database
eRow = ws.Cells(Rows.Count, 1) _
* .End(xlUp).Offset(1, 0).Row

'copy the data to the database
ws.Cells(eRow, 1).Value = Me.NameExt.Value
ws.Cells(eRow, 2).Value = Me.CompExt.Value

'clear the data
Me.NameExt.Value = ""
Me.CompExt.Value = ""
Me.NameExt.SetFocus

Unload Me

End Sub


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Problem with Userform

The best way to learn how to program with VBA is to initiate a project.
Think of something that you do on a regular basis that could be done easier
if you had a database that only needed to be updated and summarized to
produce a product. Then take one bite of the elephant at a time. Organize
data, sort data, compare data, extract data and summarize data. Insert
message boxes for information or decision making. Insert inputboxes for user
participation. Create forms to control user options and avoid human error.

As you build each piece of your project, draw a diagram of what you are
doing and you can see that you are actually building a logical system. You
simply use the VBA code to execute the steps electronically, that you would
normally do manually.
Check this site for basic programming concepts:

http://www.excel-vba.com/excel-vba-contents.htm

"vitorjose" wrote:

I have figured out my problem with the userform - i would still like
some advice on the best way to learn the excel vba programming

Thanks

On Jan 2, 12:11 pm, vitorjose wrote:
Thanks for the help - i created a userform, using a sample downloaded
from the internet, to populate 2 lists. This is the code

Option Explicit

Private Sub CmdAddInt_Click()
Dim iRow As Long
Dim ws As Worksheet
Set ws = Worksheets("Resources")

'find first empty row in database
iRow = ws.Cells(Rows.Count, 1) _
.End(xlUp).Offset(1, 0).Row

'copy the data to the database
ws.Cells(iRow, 1).Value = Me.NameInt.Value
ws.Cells(iRow, 2).Value = Me.CompInt.Value

'clear the data
Me.NameInt.Value = ""
Me.CompInt.Value = ""
'Me.NameInt.SetFocus

Unload Me

End Sub

This routine does not work - in come cases the entry form will not
display any text as i enter it and it will not copy the entered text
into the specified worksheet. The routine shown below appears to my
untrained eyes to be identical and it does exactly what i want it to
do. Can some one help me figure out why one works but not the other.
The are contained within a multipage userform. In addtion i am
interested in learning how to program within excel - i have
significant experience in using excel but no programming experience -
can someone suggest the best way to learn programming excel vba

Thanks for your help

Private Sub CmdAddEx_Click()
Dim eRow As Long
Dim ws As Worksheet
Set ws = Worksheets("Resources Ext")

'find first empty row in database
eRow = ws.Cells(Rows.Count, 1) _
.End(xlUp).Offset(1, 0).Row

'copy the data to the database
ws.Cells(eRow, 1).Value = Me.NameExt.Value
ws.Cells(eRow, 2).Value = Me.CompExt.Value

'clear the data
Me.NameExt.Value = ""
Me.CompExt.Value = ""
Me.NameExt.SetFocus

Unload Me

End Sub



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
Userform problem? law Excel Discussion (Misc queries) 0 December 3rd 07 07:54 PM
Problem with UserForm Bob Excel Programming 5 August 31st 07 02:26 PM
Userform problem Craig M Excel Programming 4 October 5th 06 01:07 AM
Userform from a Userform Problem Adrian Excel Programming 1 October 12th 05 04:57 PM
Userform Problem Todd Huttenstine Excel Programming 2 February 15th 04 09:54 PM


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