+ Reply to Thread
Results 1 to 3 of 3

Convert "EntireColumn.Copy" to a range of cells in the column

  1. #1
    Forum Contributor Rick_Stanich's Avatar
    Join Date
    11-21-2005
    Location
    Ladson SC
    MS-Off Ver
    Office365
    Posts
    1,163

    Convert "EntireColumn.Copy" to a range of cells in the column

    I am using a variable (vItem) to find its column and select it.
    PHP Code: 
    Sheet4.Rows(1).Find(What:=vItemLookAt:=xlWhole).EntireColumn.Copy 
    Then I want to paste it to Sheet3 in a new column starting at D6.
    PHP Code: 
    Sheet3.Range("D6").PasteSpecial xlPasteValuesAndNumberFormats 
    I have learned I cant select an entire column and paste to a cell in column D6 to its end.

    I need to help to figure out how to select the range of cells in Sheet4 in the found Column, not the entire column.

    What I have now.
    PHP Code: 
    Private Sub CommandButton2_Click()
        
    Dim rng1 As Range
        Dim strSearch 
    As String
        strSearch 
    vItem
        Set rng1 
    Range("A:E").Find(strSearch, , xlValuesxlWhole)
        If 
    Not rng1 Is Nothing Then
            MsgBox 
    "Find has matched - " strSearch 'for testing
            '
    the Range approach
            Sheet4
    .Rows(1).Find(What:=vItemLookAt:=xlWhole).EntireColumn.Copy
            Sheet3
    .Range("D6").PasteSpecial xlPasteValuesAndNumberFormats 'or xlPasteAll to include formulas

        Else
            MsgBox strSearch & " not found"
        End If
    End Sub 
    All assistance is appreciated.
    Regards

    Rick
    Win10, Office 365

  2. #2
    Forum Expert
    Join Date
    07-23-2018
    Location
    UK
    MS-Off Ver
    O365 32bit (Windows)
    Posts
    1,980

    Re: Convert "EntireColumn.Copy" to a range of cells in the column

    Maybe


    Please Login or Register  to view this content.
    Last edited by ByteMarks; 03-28-2024 at 08:33 AM.

  3. #3
    Forum Contributor Rick_Stanich's Avatar
    Join Date
    11-21-2005
    Location
    Ladson SC
    MS-Off Ver
    Office365
    Posts
    1,163

    Re: Convert "EntireColumn.Copy" to a range of cells in the column

    Thank you, that did thee job.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Copy cells from range "C3" to "F3" with loop and blank field
    By masterm in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-16-2015, 01:03 PM
  2. [SOLVED] What stops Range("B:HZ").EntireColumn.Hidden = True working
    By Tiger20 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-08-2015, 08:03 AM
  3. [SOLVED] Macro - copy a range of cells - paste as "values" to column - then next column - etc.
    By MIGARDEIN in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-25-2015, 07:32 PM
  4. Macro to copy cells from workbook,where column C is = "num1" AND Column D ="num2"
    By jarious87 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-10-2013, 03:30 PM
  5. why does the code Range("A1:A50") work and Range(A1).entirecolumn doesnt?
    By kjy1989 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-29-2013, 03:22 AM
  6. Replies: 3
    Last Post: 04-14-2013, 11:53 PM
  7. Copy value from column "X" paste into Column "Y" - visible cells
    By kaseyleigh in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-22-2012, 05:46 AM

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