If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > replace everthing in the column with a string of characters

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-19-04, 23:07
inho78 inho78 is offline
Registered User
 
Join Date: Sep 2004
Posts: 113
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
Reply With Quote
  #2 (permalink)  
Old 11-19-04, 23:33
McCampbell McCampbell is offline
Registered User
 
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
Reply With Quote
  #3 (permalink)  
Old 11-20-04, 00:33
shades shades is offline
Registered User
 
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
Reply With Quote
  #4 (permalink)  
Old 11-22-04, 03:37
DavidCoutts DavidCoutts is offline
Registered User
 
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On