Tips for writting macro in Excel [Closed]

Report
-
Posts
21
Registration date
Wednesday September 17, 2008
Status
Member
Last seen
May 11, 2009
-
Hello,

I have one excel file which contains more than 15000 records. for one column i need to find and replace (ex : -500 to 0) number starting with - to 0. Can any one help in this.?


Regards
Abhishek

1 reply

Posts
21
Registration date
Wednesday September 17, 2008
Status
Member
Last seen
May 11, 2009
2
try this:

With Activesheet

LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row

For i = 1 To LastRow

.Cells(i, "A").Value = Right(.Cells(i, "A").Value, Len(.Cells(i, "A").Value)-1)
Next i
End With

Subscribe To Our Newsletter!

The Best of CCM in Your Inbox

Subscribe To Our Newsletter!