Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2004
    Posts
    113

    Unanswered: replace everthing in the column with a string of characters

    hey guys,
    how to do i clear out everthing in the column till the last record(row) and insert a string of characters such as xxccffkkss12s34. I would do a find and replace macro but there are so many different combinations of a user_ID so i have to clear out everything until the last record with "xxccffkkss12s34". Every cell should have that. Also, new records are added each day so excel needs to know what the last record is instead of me scrolling down manually to the last record

    Thanks

  2. #2
    Join Date
    Mar 2004
    Location
    Oakland, CA, USA
    Posts
    26
    Insert the string "xxccffkkss12s34" to the first cell of your column then select range from 1 to n of that column and click on Edit menu --> Fill --> Down

  3. #3
    Join Date
    Oct 2003
    Posts
    1,091
    Keyboard shortcut to get to the end of the column: CTRL + DOWN arrow
    old, slow, and confused
    but at least I'm inconsistent!

    Rich
    (retired Excel 2003 user, 3/28/2008)

    How to ask a question on forums

  4. #4
    Join Date
    Jan 2004
    Location
    Aberdeen, Scotland
    Posts
    1,067
    Or in Code
    Code:
    Sub FillDown()
        Dim Lastrow As Long
        
        Lastrow = Cells(Rows.Count, 1).End(xlUp).Row
        Range(Cells(2, 1), Cells(Lastrow, 1)).Value = "xxccffkkss12s34"
    End Sub
    This works on Column A from row 2 to the last row,
    as ive just stated in your lastpost Cells comand works like this Cells(RowNumber,ColumnNumber)


    or a quick find replace macro would work like this

    Code:
    Sub FindReplace()
        
        Range("A1").EntireColumn.Replace "*", "xxccffkkss12s35"
    End Sub
    The * above is a wildcard for anything, this code wont replace blank cells to do this we wouold need to find the lastrow select the range then run 2 replaces 1 with "*" and the other with ""
    HTH
    Dave

Posting Permissions

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