if value begins with "" then

A

aintlifegrand79

I have set up a userform which takes data from about 50 textboxes and enters
it into 7 different worksheets. What I need is when a value in the
tbProjectNumber textbox begins with "E" to send the
information to an 8th worksheet as well as the other 7 worksheets. Here is a
portion of my code (The code before 'Activate Sheet 8 is not important just
put it in so you could have an idea of what else this button does) and thank
you in advance for your help.

Private Sub SaveButton_Click()
' Activate Sheet1
Sheet1.Activate
' Check to see if project number is already entered
If Not Sheet1.Columns(1).Find(tbProjectNumber.Value) Is Nothing Then
ufAlreadyEntered.Show
If Sheet1.Columns(1).Find(tbProjectNumber.Value) Is Nothing Then
' Determine the next empty row
NextRow = _
Application.WorksheetFunction.CountA(Range("A:A")) + 1
' Transfer to Sheet1(Project Type)
Cells(NextRow, 1) = tbProjectNumber.Text
Cells(NextRow, 2) = tbAEName.Text
Cells(NextRow, 3) = tbSiteOwnerName.Text
Cells(NextRow, 4) = tbPGLead.Text
Cells(NextRow, 5) = cbProjectType.Text
Cells(NextRow, 6) = cbProjectCategory.Text
' Activate Sheet8
Sheet8.Activate
' Transfer to Sheet8(Experience List)
If tbProjectNumber.Value = "E******" Then
Cells(NextRow, 1) = tbProjectNumber.Value
Cells(NextRow, 2) = tbSiteOwnerName.Text
Cells(NextRow, 3) = tbSiteLocation.Text
Cells(NextRow, 4) = tbSiteName.Text
Cells(NextRow, 5) = tbSiteUnitNumber.Text
Cells(NextRow, 6) = cbApplication.Text
Cells(NextRow, 7) = tbQuantity.Text
Cells(NextRow, 8) = tbHPRating.Text
Cells(NextRow, 9) = tbOutputVoltage.Text
Cells(NextRow, 10) = tbDelivery.Text
Cells(NextRow, 11) = tbVFDType.Text
End If
' Set the controls for the next entry
tbProjectNumber.SetFocus
Sheet7.Activate
End If
End Sub
Was this post helpful to you?
 
W

WLMPilot

If I am understanding your problem, why not change the IF statement to
If LEFT(tbProjectNumber.Value,1) = "E" Then

Les
 
A

aintlifegrand79

I think you did understand the problem correctly because I have tried that
already. The information in my userform is transfering fine to worksheets
1-7 but when the value in textbox tbProjectNumber begins with an "E" it is
still not sending the information to worksheet 8. Thanks again for your time
and response.
 
A

aintlifegrand79

No but thank you for your response it gave me more ideas but nothing has
worked yet.
 
D

Dave Peterson

Instead of starting a new thread, you could have posted a followup message to
yesterday's thread explaining why it didn't work for you.
 
A

aintlifegrand79

sorry I have just posted here before and sometimes if your question doesn't
get answered the first time i have found it is easiest to just repost it in a
little different way.
 
R

Rick Rothstein \(MVP - VB\)

Instead of starting a new thread, you could have posted a followup
sorry I have just posted here before and sometimes if your question
doesn't
get answered the first time i have found it is easiest to just repost it
in a
little different way.

But that is an unfair thing to do to the volunteers who answer question on
these newsgroups. Someone can very easily come along, reading posting from
the newest back (that's how I approach things), see your new question and,
not recognizing it from an earlier time (because you changed it slightly),
waste their time constructing (duplicating) an answer that your previous
thread already ruled out. If you keep the follow up questions in the
original thread, then, when the volunteer gets down to it, he/she can follow
the history that caused you to update the question... no one ends up wasting
time giving you an answer you already ruled out and perhaps the review of
the history from the varied responses will spark an idea for a solution that
might not have occurred to him/her had he/she simply read your new question
in your new post. Oh, and lest you think this will happen once the volunteer
gets back down to your original thread and that he/she will scroll back to
give you your answer... I wouldn't count on it... they will usually be so
annoyed that you wasted their time initially that they more than likely
won't be inclined to do that. Just something for you to consider for the
future.

Rick
 
A

aintlifegrand79

Sorry, I apparently didn't know the rules of posting here. I just have a
problem that I need to get solved and am trying to get it solved in the most
timely manner possible. I really appreciate all the help, and will stick
with the same thread from now on. With that being said i still don't have a
solution to my problem.
 
A

aintlifegrand79

Sorry, I apparently didn't know the rules of posting here. I just have a
problem that I need to get solved and am trying to get it solved in the most
timely manner possible. I really appreciate all the help, and will stick
with the same thread from now on. With that being said i still don't have a
solution to my problem.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top