Question

visual basic 6.5 replace function

Asked by: systems_ax

I need to implement a replace function recognizing that when a user enters an invalid text function into excel cell the code will auto recognize this error and auto correct it.  the user can enter this text for example "NOCHARGE" in any wrong way, how do I make my code recognize that what they mean is NOCHARGE and not ncharge or nochage.  

xSubject = LCase(Replace(Replace(Subject, "", ""), "-"))
 my code will not compile
     

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2009-10-09 at 13:33:12ID24800525
Topics

Visual Basic v1.0.5.x

,

VB Script

,

Programming Languages

Participating Experts
2
Points
500
Comments
23

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. Recognizing rules by a compiler
    I am asking this question here because this is a very live site and the experts here really take the pain to answer questions in detail. This is my question. How does the compiler recognize syntax rules? Before I ask u this question, I have browsed tonnes of web pages ab...
  2. ODBC and Ucase and LCase
    I am working with a application which has backend as Access or SQL Server The application should be independent of the backend database. In some SQL I am trying to use the String functions like lcase, Ucase or Trim . This functions work fine with Access database when connec...
  3. Recognizing OS during compilation
    I would like to recognize on what OS the compilation is performed (linux, general unix, windows (98/2000)). e.g I want to know if there are hard definitions for each one of those OS's so I can perform something like: #ifdef LINUX .... #endif #ifdef WINDOWS ... #endif etc. (B...
  4. LCASE MACROS
    Hi all, Can you do an EXCEL LCASE macro that will set all cells to lower case except for the first letter of each cell ? Is this even possible ? Please help Thanks Colm
  5. Excel VBA issue: LCase
    I'm getting this error regarding the LCase string: Compile error: Cannot find Project or Library on this line (line 19 of code at bottom): If LCase(Application.Trim(sh.Cells(r, cmin).Value)) = "grand total" And Not sh.Cells(r, cmin).EntireRow.Hidden ...
  6. lcase/ucase functions
    Argh! MSSQL database does not recognize lcase() or ucase()? Argh! Is there another function for this purpose when using ASP to connect to a MSSQL db? Also, does anyone happen to have a website that references functions for MSSQL compared to Access? I'm upgrading =)

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: purplepomegranitePosted on 2009-10-10 at 02:19:18ID: 25541522

What is that line meant to do?

The inner Replace replaces "" with "" (i.e. does nothing), and the outer replace is missing a parameter (you have specified "-" as the string to replace, but nothing to replace it with).

I also don't see how this would achieve what you are trying to achieve.

To be honest, writing such a function would be complex anyway.  You'd be best off using the built-in autocorrect feature of Excel, and just entered misspellings to be autocorrected.

 

by: systems_axPosted on 2009-10-10 at 13:26:50ID: 25543669

hi,
i don't believe I explained very well.
I have 5 cells that need to be filled in with Data in excel and depending on the fourth cell's content I am going to implement a condition statement if then to see if for example test says "none" then my condition statement will execute.  here is an example of a working code...it is just that I need to implement this condition as an add-on feature...please look at this:



Private Sub CommandButton1_Click()
 
Dim myRange As Range
Dim EmailFrom, EmailTo, EmailCC, Subject, xSubject, UserVal, PassVal As String
Dim Content, Content1, ClientName, BAType, BANote, FreeText As String
Dim FileAttached As Variant
Dim CRow, CCol As Integer
Dim oOApp, oOMail As Object
Dim sendNONE As Boolean
 
With Sheets("connect")
    EmailFrom = .Cells(2, 1).Value
    EmailNONE = "notnone@gmail.com"  ***here if the 4th cell's text is set to "none" I do  NOT WANT THE EMAIL TO BE SENT TO THIS ADDRESS AND ONLY TO BE SENT TO THE 2 EMAIL ADDRESSES BELOW***
    EmailToTech = "none@netscape.net"
    EmailCC = "none@netscape.net"
End With
        
Set myRange = Sheets("connect").Range("B9:B65000")
CRow = Application.WorksheetFunction.CountA(myRange)
Set myRange = Sheets("connect").Range("B9:B" & CStr(8 + CRow))
Set oOApp = CreateObject("Outlook.Application")
sendNONE = True
For Each Cell In myRange
 
    If IsEmpty(Cell.Offset(0, 7).Value) Then
          Subject = "Request " & Cell.Offset(0, 0).Value & "_" & Cell.Offset(0, 4).Value
                             
 ****in here I need to put in a condtion statement : if cell 4 contains text none than do not send to     EmailNONE = notnone@gmail.com and only send to EmailToTech = "none@netscape.net"
And  EmailCC = "none@netscape.net"
             
        If InStr(1, xSubject, "none") > 1 Then
        sendNONE = False
        End If
        
        ClientName = Cell.Offset(0, 0).Value
        TpName = Cell.Offset(0, 4).Value
        BAType = Cell.Offset(0, 2).Value
        BANote = Cell.Offset(0, 3).Value
        FreeText = Cell.Offset(0, 6).Value
        Content = ClientName & vbTab & vbTab & Cell.Offset(0, 1).Value & vbCrLf & vbCrLf
        Content = Content & Cell.Offset(0, 4).Value & vbTab & vbTab & Cell.Offset(0, 5) & vbCrLf & vbCrLf
        Content = Content & FreeText & vbCrLf & vbCrLf
        Content = Content & vbCrLf & "Please contact none@netscape.net if you have any question."
        Content = Content & vbCrLf & "THANK YOU." & vbCrLf & vbCrLf & "private" & vbCrLf & "none" & vbCrLf & "none" & vbCrLf & "none" & vbCrLf & "none" & vbCrLf & "none@netscape.com"
        
        Content1 = "some content." & vbCrLf & vbCrLf & BAType & vbCrLf & vbCrLf
        Content1 = Content1 & ClientName & " QID" & vbTab & vbTab & Cell.Offset(0, 1).Value & vbCrLf
        Content1 = Content1 & Cell.Offset(0, 4).Value & " QID" & vbTab & vbTab & Cell.Offset(0, 5) & vbCrLf & vbCrLf
        Content1 = Replace(Content1, ":", "")
        Content1 = Replace(Content1, "/", "")
        Content1 = Content1 & BANote & vbCrLf
        
        Set oOMail = oOApp.CreateItem(0)
        On Error GoTo Jump
        With oOMail
            '.From = EmailFrom
            .Subject = Subject
            .To = EmailNONE
            .CC = EmailCC
            .body = Content
            '.Send
            
         I PROBBALY NEED TO INDICATE HERE THAT ALSO   
        If InStr(1, xSubject, "none") > 1 Then
            sendNONE = False
        Else
            .Send
            
        End If
                       
Jump:
        End With
        Set oOMail = Nothing
        
        Set oOMail1 = oOApp.CreateItem(0)
        On Error GoTo Jump1
        With oOMail1
            '.From = EmailFrom
            .Subject = "BA Copy for " & ClientName & " - " & TpName & "/ " & BAType
            .To = EmailToTech
            .CC = EmailCC
            .body = Content1
              .Send
                  
                          
Jump1:
        End With
        Set oOMail1 = Nothing
        Cell.Offset(0, 7).Value = "Y"
     End If
Next
Set oOApp = Nothing
End Sub

                                              
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:

Select allOpen in new window

 

by: systems_axPosted on 2009-10-10 at 15:25:00ID: 25544114

can you help?

 

by: robberbaronPosted on 2009-10-10 at 17:05:31ID: 25544338

if the contents of the cell can only be a certain list, can you implement a Drop-down listbox that only contains these items.
Just place the listbox over the cell, and set the linked cell to be a hidden cell elsewhere on the workbook. Give it a range name.
Need to do this because the list box returns the index of the selected list, not the contents. Use a lookup function of the selected index to get the text value into the desired cell.

 

by: systems_axPosted on 2009-10-10 at 17:21:47ID: 25544391

hi robberbaron,
thank you for replying, can you please look at 10/10/09 03:26 PM, ID: 25543669 above.  I've decided to just let the user know what to enter but now have difficulties with setting a condition foe example, if this cell contains word "none" do not send email to 1 of the 3 email addresses but if the word is anything but "none" sent email to all three email addresses. can you please take a look at my code and help me.  thank you

 

by: robberbaronPosted on 2009-10-10 at 18:16:21ID: 25544545

does this give what you want ?
if sCheckCell contains "none" , then the message is sent to EmailTech, otherwise send to EmailNone.


I have moved a few things around and also changed the variable Cell to be rngCell to remove my confusion as Cell is also a Excel property.


Private Sub SendMail()
 
    Dim myRange As Range
    Dim EmailFrom, EmailTo, EmailCC, Subject, xSubject, UserVal, PassVal As String
    Dim Content, Content1, ClientName, BAType, BANote, FreeText As String
    Dim FileAttached As Variant
    Dim CRow, CCol As Integer, rngCell As Range
    
    Dim oOApp, oOMail As Object
    Dim sendNONE As Boolean
     
    With Sheets("connect")
        EmailFrom = .Cells(2, 1).Value
        EmailNONE = "notnone@gmail.com"
        '***here if the 4th rngCell's text is set to "none" '
        'I do  NOT WANT THE EMAIL TO BE SENT TO THIS ADDRESS AND ONLY TO BE SENT TO THE 2 EMAIL ADDRESSES BELOW***'
        EmailToTech = "none@netscape.net"
        EmailCC = "none@netscape.net"
    End With
            
    Set myRange = Sheets("connect").Range("B9:B65000")
    CRow = Application.WorksheetFunction.CountA(myRange)
    Set myRange = Sheets("connect").Range("B9:B" & CStr(8 + CRow))
    Set oOApp = CreateObject("Outlook.Application")
    sendNONE = True
    For Each rngCell In myRange
     
        If IsEmpty(rngCell.Offset(0, 7).Value) Then
              Subject = "Request " & rngCell.Offset(0, 0).Value & "_" & rngCell.Offset(0, 4).Value
                                 
              sCheckCell = rngCell.Offset(0, 4).Value  'the cell that may contain 'none''
 
            
            ClientName = rngCell.Offset(0, 0).Value
            TpName = rngCell.Offset(0, 4).Value
            BAType = rngCell.Offset(0, 2).Value
            BANote = rngCell.Offset(0, 3).Value
            FreeText = rngCell.Offset(0, 6).Value
            Content = ClientName & vbTab & vbTab & rngCell.Offset(0, 1).Value & vbCrLf & vbCrLf
            Content = Content & rngCell.Offset(0, 4).Value & vbTab & vbTab & rngCell.Offset(0, 5) & vbCrLf & vbCrLf
            Content = Content & FreeText & vbCrLf & vbCrLf
            Content = Content & vbCrLf & "Please contact none@netscape.net if you have any question."
            Content = Content & vbCrLf & "THANK YOU." & vbCrLf & vbCrLf & "private" & vbCrLf & "none" & vbCrLf & "none" & vbCrLf & "none" & vbCrLf & "none" & vbCrLf & "none@netscape.com"
            
            Content1 = "some content." & vbCrLf & vbCrLf & BAType & vbCrLf & vbCrLf
            Content1 = Content1 & ClientName & " QID" & vbTab & vbTab & rngCell.Offset(0, 1).Value & vbCrLf
            Content1 = Content1 & rngCell.Offset(0, 4).Value & " QID" & vbTab & vbTab & rngCell.Offset(0, 5) & vbCrLf & vbCrLf
            Content1 = Replace(Content1, ":", "")
            Content1 = Replace(Content1, "/", "")
            Content1 = Content1 & BANote & vbCrLf
            
            Set oOMail = oOApp.CreateItem(0)
            On Error GoTo Jump
            With oOMail
                '.From = EmailFrom'
                .Subject = Subject
                ' ****in here I need to put in a condtion statement : if rngCell 4 contains text 'none' than do not send to'
                'EmailNONE = notnone@gmail.com and only send to EmailToTech = "none@netscape.net"'
                'And  EmailCC = "none@netscape.net"
                 
                If InStr(1, sCheckCell, "none") > 1 Then
                   .To = EmailToTech
                 Else
                    .To = EmailNONE
                End If
                
                .CC = EmailCC
                .body = Content
                .Send
            End With
            
Jump:
            Set oOMail = Nothing
            
            Set oOMail1 = oOApp.CreateItem(0)
            On Error GoTo Jump1
            With oOMail1
                '.From = EmailFrom'
                .Subject = "BA Copy for " & ClientName & " - " & TpName & "/ " & BAType
                .To = EmailToTech
                .CC = EmailCC
                .body = Content1
                .Send
          End With
                              
Jump1:
            
            Set oOMail1 = Nothing
            rngCell.Offset(0, 7).Value = "Y"
         End If
    Next
    Set oOApp = Nothing
End Sub
                                              
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:

Select allOpen in new window

 

by: robberbaronPosted on 2009-10-10 at 18:24:35ID: 25544557

sorry. just re-read.

You are sending 2 different messages.

Please advise if the recipients for message 1 should be all 3 listed, or just 2, depending upon value of CheckCell.

 

by: systems_axPosted on 2009-10-10 at 23:09:44ID: 25545033

hi robberbaron,
thank you...is ther a way to implement a Replace function within the same code.  for example when user enters "none" wrong such as non or neno the code will be able to fix it automatically and setills end an appropriate email to everyone.
thank you

 

by: robberbaronPosted on 2009-10-11 at 03:47:09ID: 25545481

not really. thats why i suggested using the drop down so that you control the input.

otherwise, the number of combinations for autocomplete would get difficult.

 

by: systems_axPosted on 2009-10-11 at 10:22:19ID: 25546594

hi robberbaron,
i researched that autofill feature in excel and could not find anyting decent that could actually help.  is it possible to implement a drop box within a excel cell with 4 or 5 different options so that the user simply selects one option form the drop box and cannot type anything else?

thank you

 

by: systems_axPosted on 2009-10-11 at 11:03:44ID: 25546734

i don't know what happened now but this does not work...it worked yesterday.

 

by: systems_axPosted on 2009-10-11 at 13:06:19ID: 25547141

robberbaron
I am sending 2 different messages.

if cell0,2 is set to NONE then only the follopwing needs to execute:

End With
        Set oOMail = Nothing
        Set oOMail1 = oOApp.CreateItem(0)
        On Error GoTo Jump1
        With oOMail1
            .Subject = "private" & ClientName & " - " & TpName & "/ " & BAType
            .To = EmailToTech
            .CC = EmailCC
            .body = Content1
            .Send
 
if it is not set to none then all 2 messages must be sent to all 3 addresses

 

by: systems_axPosted on 2009-10-11 at 15:07:11ID: 25547626

i figured out this one but now have same email sent twice.  do I need to post it under a different topic?

 

by: robberbaronPosted on 2009-10-12 at 05:26:24ID: 25550557

1/dropdown list with 5 options only : Definitely way to go. Use a Dropdown List... can only select your options
  show the Forms toolbar and insert a Combobox. Format control to give it a range of cells that holds available options and an cellink to hold the selected index. Then use a Vlookup funtion to put the selected item into the cell behind the combo box.

2/  to only send the second message if checkcell has NONE , move the IF block outside the first send section. see attached code chunk.

 Private Sub SendMail()
 
    Dim myRange As Range
    Dim EmailFrom, EmailTo, EmailCC, Subject, xSubject, UserVal, PassVal As String
    Dim Content, Content1, ClientName, BAType, BANote, FreeText As String
    Dim FileAttached As Variant
    Dim CRow, CCol As Integer, rngCell As Range
    
    Dim oOApp, oOMail As Object
    Dim sendNONE As Boolean
     
    With Sheets("connect")
        EmailFrom = .Cells(2, 1).Value
        EmailNONE = "notnone@gmail.com"
        EmailToTech = "none@netscape.net"
        EmailCC = "none@netscape.net"
    End With
            
    Set myRange = Sheets("connect").Range("B9:B65000")
    CRow = Application.WorksheetFunction.CountA(myRange)
    Set myRange = Sheets("connect").Range("B9:B" & CStr(8 + CRow))
    Set oOApp = CreateObject("Outlook.Application")
    sendNONE = True
    For Each rngCell In myRange
     
        If IsEmpty(rngCell.Offset(0, 7).Value) Then
              Subject = "Request " & rngCell.Offset(0, 0).Value & "_" & rngCell.Offset(0, 4).Value
                                 
              sCheckCell = rngCell.Offset(0, 4).Value  'the cell that may contain 'none''
 
            
            ClientName = rngCell.Offset(0, 0).Value
            TpName = rngCell.Offset(0, 4).Value
            BAType = rngCell.Offset(0, 2).Value
            BANote = rngCell.Offset(0, 3).Value
            FreeText = rngCell.Offset(0, 6).Value
            Content = ClientName & vbTab & vbTab & rngCell.Offset(0, 1).Value & vbCrLf & vbCrLf
            Content = Content & rngCell.Offset(0, 4).Value & vbTab & vbTab & rngCell.Offset(0, 5) & vbCrLf & vbCrLf
            Content = Content & FreeText & vbCrLf & vbCrLf
            Content = Content & vbCrLf & "Please contact none@netscape.net if you have any question."
            Content = Content & vbCrLf & "THANK YOU." & vbCrLf & vbCrLf & "private" & vbCrLf & "none" & vbCrLf & "none" & vbCrLf & "none" & vbCrLf & "none" & vbCrLf & "none@netscape.com"
            
            Content1 = "some content." & vbCrLf & vbCrLf & BAType & vbCrLf & vbCrLf
            Content1 = Content1 & ClientName & " QID" & vbTab & vbTab & rngCell.Offset(0, 1).Value & vbCrLf
            Content1 = Content1 & rngCell.Offset(0, 4).Value & " QID" & vbTab & vbTab & rngCell.Offset(0, 5) & vbCrLf & vbCrLf
            Content1 = Replace(Content1, ":", "")
            Content1 = Replace(Content1, "/", "")
            Content1 = Content1 & BANote & vbCrLf
            
            If InStr(1, sCheckCell, "none") = 0 Then
                'cell does not have none'
                'send msg1'
                Set oOMail = oOApp.CreateItem(0)
                On Error GoTo Jump
                With oOMail
                    '.From = EmailFrom'
                    .Subject = Subject
 
                    .To = EmailNONE
                    .CC = EmailCC
                    .body = Content
                    .Send
                End With
                
Jump:
                Set oOMail = Nothing
            End If
            
            'now send msg2 to Tech'
            Set oOMail1 = oOApp.CreateItem(0)
            On Error GoTo Jump1
            With oOMail1
                '.From = EmailFrom'
                .Subject = "BA Copy for " & ClientName & " - " & TpName & "/ " & BAType
                .To = EmailToTech
                .CC = EmailCC
                .body = Content1
                .Send
          End With
                              
Jump1:
            
            Set oOMail1 = Nothing
            rngCell.Offset(0, 7).Value = "Y"
         End If
         
    Next
    Set oOApp = Nothing
End Sub

                                              
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:

Select allOpen in new window

 

by: systems_axPosted on 2009-10-12 at 09:52:32ID: 25552813

thank you but I figured my initial question yesterday.
right now I need to insert a combo box into my spreadsheet with 2 different options so that the user does not have t manually enter the text and can simply select it.

should I open a new question?

 

by: robberbaronPosted on 2009-10-14 at 03:53:49ID: 25568995

ive shown how to use the dropdown list using a combo box already.

 

by: systems_axPosted on 2009-10-16 at 09:57:28ID: 25591213

sorry where is it, I don't see it in this thread.

 

by: robberbaronPosted on 2009-10-16 at 21:19:57ID: 25594744

1/dropdown list with 5 options only : Definitely way to go. Use a Dropdown List... can only select your options
  show the Forms toolbar and insert a Combobox. Format control to give it a range of cells that holds available options and an cellink to hold the selected index. Then use a Vlookup funtion to put the selected item into the cell behind the combo box.

 

by: systems_axPosted on 2009-10-17 at 19:21:04ID: 25598489

i added the combo box with 2 different options but how do I prevent users from being able to type anything into it except these 2 items?

 

by: robberbaronPosted on 2009-10-18 at 22:16:26ID: 25602726

attached is an example. Put the dropdown over the desired output cell which makes it hard for user to change the cell.
(can always try protecting the worksheet but that often has issues as well.)




 

by: robberbaronPosted on 2009-10-18 at 22:17:13ID: 25602730

with attachment this time.

 

by: systems_axPosted on 2009-11-05 at 10:54:36ID: 25752633

sorry, robberbaron,
did not mean to keep this ungraded...I'll take a look at it shortly.

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...