VB scripts with excel?

I have created a spreadsheet for jobs that I am currently advertising, I would like to create a VB user form where I can enter the job details and it will insert them into the spreadsheet, into columns 1,2,3 and 5 They are named Ref – Job Title – Location – End Date I have created 4 text boxes to enter the data into and I have created a drop down list to select what sheet I want the data to be entered into. I have also created two buttons, one to enter the data and one to close the form. This is the code i have but it doesn’t work. I have got this code from a tutorial but it doesn’t seem to work as i have tried to change it to change it to meet my requirements. Please could you give me as much help as possible. Thanks in advance Jamie Private Sub cmdAdd_Click() Dim iRow As Long Dim ws As Worksheet Set ws = Worksheets("Area1") 'find first empty row in database iRow = ws.Cells.Find(What:="*", SearchOrder:=xlRows, _ SearchDirection:=xlPrevious, LookIn:=xlValues).Row + 1 'check for a ref number' If Trim(Me.Ref.Value) = "" Then Me.Ref.SetFocus MsgBox "Please enter a part number" Exit Sub End If 'copy the data to the database ws.Cells(iRow, 1).Value = Me.Ref.Value ws.Cells(iRow, 2).Value = Me.JobTitle.Value ws.Cells(iRow, 3).Value = Me.Branch.Value ws.Cells(iRow, 5).Value = Me.EndDate.Value 'clear the data Me.Ref.Value = "" Me.JobTitle.Value = "" Me.Branch.Value = "" Me.EndDate.Value = "" Me.Ref.SetFocus End Sub

Asked By: - 9/14/2012
Best Answer - Chosen by Asker
The code seems valid. If your userform is showing, I don't see what the problem could be. You'd need to make sure the command button is named appropriately (cmdAdd) and that it is linked to the code you've inserted, and that its associated with the userform (double-click the cmdAdd button on your form in design mode).
Answered By: Blackened - 9/14/2012
Additional Answers (2)
The code refers for "Me." starting in line 9 of your code, but there is no definition of what "Me." is before that. Is that where the code is failing (line 9)?
Answered By: Doreen - 9/14/2012
In what way is it not working?
Answered By: FlashDarkness - 9/14/2012
Sponsored results
Over 483 Local Jobs Now Hiring In Your Area. $18-$87/Hr - Apply Today!
Earn $95/hr Bookkeeping Right From Home. Free Video Explains All!
Click. Search. Apply. Free!
Jobs hiring now near your local area. Find a job and apply now.

Other Career Questions

What is your current job? Why did you choose this job? What do you enjoy about your job? What do you dislike about your job? What would be your perfect job? Would you rather have this j...
3 answers - Asked By: drop pants not bombs!.♥ - 3/2/2010
Where are the jobs? Is productivity and globalization creating a permanent “recession” of jobs? My main issue is I am doing a paper for school and have no idea where to begin. I was hoping suggestions...
4 answers - Asked By: bayebd24【ツ】 - 11/21/2007
Hi ok im 19 and about to start college to do an acess course into a university. Ive been browsing through all the courses and im tottaly stuck! I thought politics but im scared ill end up with some r...
1 answers - Asked By: roseparkerly - 1/26/2009

Content is not owned or controlled by Monster. Any content concerns should be addressed with Yahoo!
Yahoo! Does not evaluate or guarantee the accuracy of any Yahoo! Answers content. Yahoo! Disclaimer.

Popular Articles

Best-Paying Work-from-Home Jobs Article Rating
It’s easier than ever to work from home. Of course, not every job is a mobile job, and some companies aren’t interested in having their employees work from home.
2013 Marketing Jobs Outlook Article Rating
The US may be facing another year of anemic hiring overall, but that won't be the case in the high-orbit world of multichannel, digital media marketing.
For Employers: Post Jobs | Search Resumes | Advertise
About Monster | Work for Monster | Advertise with Us | AdChoices | Partner with Us | Investor Relations | Social Media
Terms of Use | Privacy Center | Accessibility Center | Help | Security | Contact Us | Sitemap | Mobile
©2014 Monster - All Rights Reserved U.S. Patents No. 5,832,497; 7,599,930 B1; 7,827,125 and 7,836,060 MWW - Looking for Monster Cable? - V: 2014.1.40.24-219