+ Reply to Thread
Results 1 to 3 of 3

Copy contents if.......

  1. #1
    Forum Contributor
    Join Date
    02-16-2006
    Posts
    241

    Talking Copy contents if.......

    I am looking for a way to do the following:

    If ("d1:d999") = "text in the cell" then copy ("e1:e999") to ("f1:f999")

    In other words I have a standard text like "tax" in d3, d18, d44, etc. If this text exsists then I want to copy e3, e18, e44, etc. to f3, f18, f44.

    If this possible?

    Thanks,

    Met

  2. #2
    Toppers
    Guest

    RE: Copy contents if.......

    Hi,

    Sub CopyEtoF()
    mytext = "Whatever you want"
    For i = 1 To 999
    If Cells(i, "D") = mytext Then Cells(i, "F") = Cells(i, "E")
    Next i
    End Sub

    "Metrazal" wrote:

    >
    > I am looking for a way to do the following:
    >
    > If ("d1:d999") = "text in the cell" then copy ("e1:e999") to
    > ("f1:f999")
    >
    > In other words I have a standard text like "tax" in d3, d18, d44, etc.
    > If this text exsists then I want to copy e3, e18, e44, etc. to f3, f18,
    > f44.
    >
    > If this possible?
    >
    > Thanks,
    >
    > Met
    >
    >
    > --
    > Metrazal
    > ------------------------------------------------------------------------
    > Metrazal's Profile: http://www.excelforum.com/member.php...o&userid=31648
    > View this thread: http://www.excelforum.com/showthread...hreadid=513359
    >
    >


  3. #3
    Tom Ogilvy
    Guest

    Re: Copy contents if.......

    Sub copydata()
    Dim cell as Range
    for each cell in Range("d1:d999")
    if instr(1,cell.Value,"tax",vbTextCompare) then
    cell.offset(0,1).copy cell.offset(0,2)
    end if
    Next
    End Sub

    --
    Regards,
    Tom Ogilvy

    "Metrazal" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I am looking for a way to do the following:
    >
    > If ("d1:d999") = "text in the cell" then copy ("e1:e999") to
    > ("f1:f999")
    >
    > In other words I have a standard text like "tax" in d3, d18, d44, etc.
    > If this text exsists then I want to copy e3, e18, e44, etc. to f3, f18,
    > f44.
    >
    > If this possible?
    >
    > Thanks,
    >
    > Met
    >
    >
    > --
    > Metrazal
    > ------------------------------------------------------------------------
    > Metrazal's Profile:

    http://www.excelforum.com/member.php...o&userid=31648
    > View this thread: http://www.excelforum.com/showthread...hreadid=513359
    >




+ 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