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: 50
Default if value begins with "" then

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?


 
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
If texbox value begins with "E" then send to another sheet. aintlifegrand79 Excel Programming 1 February 13th 08 10:45 PM
How do I write "begins with"? Terri Excel Discussion (Misc queries) 1 February 22nd 07 01:48 PM
Sorting text that begins with "the" or "a" kcg727 Excel Discussion (Misc queries) 2 February 25th 06 10:44 PM
Backup to specific folder if workbook names begins with "NSR" or "MAC" GregR Excel Programming 3 May 6th 05 12:24 AM
highest value in a Row, that begins with "21" or "28" Fritz Zwiefelhofer Excel Programming 1 February 8th 04 10:22 PM


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