+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    03-09-2010
    Location
    Utah
    MS-Off Ver
    Excel 2007
    Posts
    4

    pasting "go to" values into a new column

    I used "go to" to find the appropriate cells in a long column that i want to copy. When I paste them into a new column, they past one after another in consecutive rows (ie: A1,A2,A3,A4,A5,etc.). I want them to show up in the same rows that they were in originally (maybe A1,A100,A115,A189, and so on) leaving the other cells alone. How do I do this?

  2. #2
    Forum Guru 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Vienna, VA, USA
    MS-Off Ver
    Excel 2003, 2007
    Posts
    2,242

    Re: pasting "go to" values into a new column

    Do you mean that you are using Go To Special to select a noncontinuous range? I don't know of a way to do this except by VBA. This code is for 2007 (for 2003 it would need to constrain its validity check to column IV).

    Code:
    Public Sub CopyParallel()
       Dim c As Range
       Dim dest As String
     
       dest = UCase(InputBox("Enter destination column:"))
       If (dest >= "A" And dest <= "Z") Or _
          (dest >= "AA" And dest <= "ZZ") Or _
          (dest >= "AAA" And dest <= "XFD") Then
          For Each c In Selection
             Range(dest & c.Row).Value = c.Value
          Next c
       Else
          MsgBox dest & " is not a valid column"
       End If
     
    End Sub
    Making the world a better place one fret at a time
    ||||||

    If someone helped you, please click on the star icon at the bottom of their post

    If your problem is solved, please update the first post:
    EDIT, Go Advanced button, set Prefix to SOLVED

    [code]
    ' Enclose code in tags like this
    [/code]

    Don't attach a screenshot
    --just attach your Excel file! It's easier and will let us experiment with your data, formulas, and code.

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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.2.0