Results 1 to 2 of 2

Copy/move a word from a cell in a column to another column and autofill

Threaded View

  1. #1
    Registered User
    Join Date
    01-23-2009
    Location
    Chicago
    MS-Off Ver
    Excel 2003
    Posts
    58

    Copy/move a word from a cell in a column to another column and autofill

    Hi, I have the following code. In this spreadsheet, in column G there are some rows with the word "Transfer: PIK" or "Transfer: BLK" randomly placed. I want this code to copy this column, move it to column C of the worksheet (either by inserting a new column or by adding to an empty column) and autofill until the next "PIK" or "BLK" is reached and then do the same thing for the next "PIK" or "BLK"

    This code is copying the entire sentence "Transfer: PIK" or "Transfer: BLK" to column A. I need help with the following:
    1. To copy it to column C instead of A
    2. To copy only PIK/BLK part and ignore the rest
    3. To Autofill PIK/BLK until the next PIK/BLK is reached such that only the rows which have data in cell D are autofilled.

    Thank you.


    Sub Buyer()
    
    With Columns(1)
            .Offset(, 7).Cut
            .Insert Shift:=xlToRight
        End With
     
        Lastrow = Cells(Rows.Count, "Transfer").End(xlUp).Row
     
        With Range("C1:C" & Lastrow)
            .SpecialCells(xlCellTypeBlanks).FormulaR1C1 = "=R[-5]C"
            .Value = .Value
        End With
    End Sub
    Last edited by excelaspire0219; 02-10-2009 at 10:51 AM.

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