+ Reply to Thread
Results 1 to 3 of 3

Concentrate email address with selection

Hybrid View

mdshotgun Concentrate email address... 12-01-2011, 07:39 AM
pike Re: Concentrate email address... 12-02-2011, 02:04 AM
mdshotgun Re: Concentrate email address... 12-02-2011, 05:08 AM
  1. #1
    Forum Contributor
    Join Date
    05-16-2010
    Location
    glasgow scothland
    MS-Off Ver
    Excel 2007
    Posts
    112

    Concentrate email address with selection

    Hello all,

    Hope someone can help.
    In the attached i have names in column A and in B the person can choose either
    yes/no.
    If they choose yes then their name is copied to sheet2 when they press the make selection button.
    What i need help with is i would like the company email address (@companyname.com) to concentrate to what ever names are copied in sheet2.

    Thanks in advance.
    Attached Files Attached Files
    Last edited by mdshotgun; 12-02-2011 at 05:08 AM.

  2. #2
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,342

    Re: Concentrate email address with selection

    Hi mdshotgun
    working with your code try....
    Option Explicit
    Sub makeselection()
        Dim rng As Range
        Dim cell, Temp As String
        Application.ScreenUpdating = False
        Set rng = Range("B3:B27")
        For Each cell In rng
            If cell.Value = "yes" Then
    
                Temp = cell.Offset(0, -1).Value
                cell.Offset(0, -1).Value = Replace(cell.Offset(0, -1).Value, " ", ".") & "@companyname.com"
                cell.EntireRow.Copy Destination:=Sheets("Sheet2").Range("A" & Rows.Count).End(xlUp).Offset(1, 0)
                cell.Offset(0, 1).Font.ColorIndex = 2
                cell.Offset(0, -1).Value = Temp
            End If
        Next
        With Sheets("sheet2")
            .Columns("B").Hidden = True
            .Range("a1:aa200").Interior.ColorIndex = xlNone
        End With
        Application.ScreenUpdating = True
    End Sub
    If the solution helped please donate to RSPCA

    Site worth visiting: Rabbitohs

  3. #3
    Forum Contributor
    Join Date
    05-16-2010
    Location
    glasgow scothland
    MS-Off Ver
    Excel 2007
    Posts
    112

    Re: Concentrate email address with selection

    Wow Pike,

    That is some excellent code.
    Thank you for your help once again.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1