LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Userform


need help specifing cells that I want info to go in.


Code
-------------------

Private Sub cmdAdd_Click()
Dim iRow As Long
Dim ws As Worksheet
Set ws = Worksheets("") *'I want this to be the active sheet*

'check for a part number
If Trim(Me.a.Value) = "" Then
Me.a.SetFocus
MsgBox "Please enter a"
Exit Sub
End If

'copy the data to the database
ws.Cells('the column and row/cell name).Value = Me.a.Value ""
ws.Cells('the column and row/cell name).Value = Me.c.Value ""
ws.Cells('the column and row/cell name).Value = Me.s.Value ""
ws.Cells('the column and row/cell name).Value = Me.z.Value ""
ws.Cells('the column and row/cell name).Value = Me.mlast.Value ""
ws.Cells('the column and row/cell name).Value = Me.mfirst.Value ""
ws.Cells('the column and row/cell name).Value = Me.mmail.Value = ""
ws.Cells('the column and row/cell name).Value = Me.mhome.Value ""
ws.Cells('the column and row/cell name).Value = Me.mme.Value ""
ws.Cells('the column and row/cell name).Value = Me.mwork.Value ""
ws.Cells('the column and row/cell name).Value = Me.mrk.Value ""
ws.Cells('the column and row/cell name).Value = Me.mcell.Value ""
ws.Cells('the column and row/cell name).Value = Me.mll.Value ""
ws.Cells('the column and row/cell name).Value = Me.flast.Value ""
ws.Cells('the column and row/cell name).Value = Me.ffirst.Value ""
ws.Cells('the column and row/cell name).Value = Me.fmail.Value ""
ws.Cells('the column and row/cell name).Value = Me.fhome.Value ""
ws.Cells('the column and row/cell name).Value = Me.fme.Value ""
ws.Cells('the column and row/cell name).Value = Me.fwork.Value ""
ws.Cells('the column and row/cell name).Value = Me.frk.Value ""
ws.Cells('the column and row/cell name).Value = Me.fcell.Value ""
ws.Cells('the column and row/cell name).Value = Me.fll.Value ""

'clear the data
Me.a.Value = ""
Me.c.Value = ""
Me.s.Value = ""
Me.z.Value = ""
Me.mlast.Value = ""
Me.mfirst.Value = ""
Me.mmail.Value = ""
Me.mhome.Value = ""
Me.mme.Value = ""
Me.mwork.Value = ""
Me.mrk.Value = ""
Me.mcell.Value = ""
Me.mll.Value = ""
Me.flast.Value = ""
Me.ffirst.Value = ""
Me.fmail.Value = ""
Me.fhome.Value = ""
Me.fme.Value = ""
Me.fwork.Value = ""
Me.frk.Value = ""
Me.fcell.Value = ""
Me.fll.Value = ""
Me.a.SetFocus

End Sub

-------------------


Want must I do to this code to make it work. So that I can tell th
text box to enter the userform info into different cells as I see fit.

Than

--
oberon.blac
-----------------------------------------------------------------------
oberon.black's Profile: http://www.excelforum.com/member.php...fo&userid=2673
View this thread: http://www.excelforum.com/showthread.php?threadid=46646

 
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
Looping procedure calls userform; how to exit loop (via userform button)? KR Excel Programming 6 July 27th 05 12:57 PM
Activating userform and filling it with data form row where userform is activate Marthijn Beusekom via OfficeKB.com[_2_] Excel Programming 3 May 6th 05 05:44 PM
Access from add_in userform to main template userform.... Ajit Excel Programming 1 November 18th 04 05:15 PM
Linking userform to userform in Excel 2003 missmelis01 Excel Programming 2 August 27th 04 08:07 PM
Userform inside another userform Ryan Excel Programming 0 April 23rd 04 08:01 PM


All times are GMT +1. The time now is 07:33 PM.

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"