Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If I am understanding your problem, why not change the IF statement to
If LEFT(tbProjectNumber.Value,1) = "E" Then Les "aintlifegrand79" wrote: 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? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() "WLMPilot" wrote: If I am understanding your problem, why not change the IF statement to If LEFT(tbProjectNumber.Value,1) = "E" Then Les "aintlifegrand79" wrote: 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? |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I guess that yesterday's response didn't work, huh?
aintlifegrand79 wrote: 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? -- Dave Peterson |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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. "WLMPilot" wrote: If I am understanding your problem, why not change the IF statement to If LEFT(tbProjectNumber.Value,1) = "E" Then Les "aintlifegrand79" wrote: 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? |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
No but thank you for your response it gave me more ideas but nothing has
worked yet. "Dave Peterson" wrote: I guess that yesterday's response didn't work, huh? aintlifegrand79 wrote: 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? -- Dave Peterson |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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. aintlifegrand79 wrote: No but thank you for your response it gave me more ideas but nothing has worked yet. "Dave Peterson" wrote: I guess that yesterday's response didn't work, huh? aintlifegrand79 wrote: 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? -- Dave Peterson -- Dave Peterson |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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. "Dave Peterson" wrote: 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. aintlifegrand79 wrote: No but thank you for your response it gave me more ideas but nothing has worked yet. "Dave Peterson" wrote: I guess that yesterday's response didn't work, huh? aintlifegrand79 wrote: 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? -- Dave Peterson -- Dave Peterson |
#9
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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. 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 |
#10
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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. "Rick Rothstein (MVP - VB)" wrote: 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. 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 |
#11
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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. "Rick Rothstein (MVP - VB)" wrote: 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. 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
If texbox value begins with "E" then send to another sheet. | Excel Programming | |||
How do I write "begins with"? | Excel Discussion (Misc queries) | |||
Sorting text that begins with "the" or "a" | Excel Discussion (Misc queries) | |||
Backup to specific folder if workbook names begins with "NSR" or "MAC" | Excel Programming | |||
highest value in a Row, that begins with "21" or "28" | Excel Programming |