Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Bob Phillips
 
Posts: n/a
Default Delete 4 to 5 digits from left in a cell


iLastRow = Cells(Rows.Count,"A").End(xlUp).Row
For i = 1 To iLastRow
With Cells(i,"A")
iPos = InStr(":",.Value)
if iPos 0 Then
.Value = Right(.Value, Len(.Value) - iPos)
End If
End With
Next i

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"saziz" wrote in
message ...

Hi,
I got a sheet where I need to delete number followed by ':'. All these
numbers are at the left in a cell like this--- 300: text.... few
hundred rows. Any help please?
Aziz


--
saziz
------------------------------------------------------------------------
saziz's Profile:

http://www.excelforum.com/member.php...fo&userid=6350
View this thread: http://www.excelforum.com/showthread...hreadid=536939



  #2   Report Post  
Posted to microsoft.public.excel.misc
saziz
 
Posts: n/a
Default Delete 4 to 5 digits from left in a cell


Hi Bob,
I fix my problem, thank you. But wanted to try your code.
At this line: For i = 1 To Len(a) it gives me an error "Invalid outside
procedure"
I don't know what is.
Aziz


--
saziz
------------------------------------------------------------------------
saziz's Profile: http://www.excelforum.com/member.php...fo&userid=6350
View this thread: http://www.excelforum.com/showthread...hreadid=536939

  #3   Report Post  
Posted to microsoft.public.excel.misc
Bob Phillips
 
Posts: n/a
Default Delete 4 to 5 digits from left in a cell

You need to put it in a macro, for instance

Sub RemoveData()
iLastRow = Cells(Rows.Count,"A").End(xlUp).Row
For i = 1 To iLastRow
With Cells(i,"A")
iPos = InStr(":",.Value)
if iPos 0 Then
.Value = Right(.Value, Len(.Value) - iPos)
End If
End With
Next i
End Sub

then run RemoveData

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"saziz" wrote in
message ...

Hi Bob,
I fix my problem, thank you. But wanted to try your code.
At this line: For i = 1 To Len(a) it gives me an error "Invalid outside
procedure"
I don't know what is.
Aziz


--
saziz
------------------------------------------------------------------------
saziz's Profile:

http://www.excelforum.com/member.php...fo&userid=6350
View this thread: http://www.excelforum.com/showthread...hreadid=536939



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom functions calculating time arguments Help Desperate Bill_De Excel Worksheet Functions 12 April 25th 06 02:22 AM
resetting last cell jagdish.eashwar Excel Discussion (Misc queries) 11 March 31st 06 02:06 AM
auto delete characters in cell left of @ sign Rusty Setting up and Configuration of Excel 9 January 23rd 06 06:14 PM
delete cell that doesn't contain a specific word [email protected] Excel Discussion (Misc queries) 1 October 12th 05 05:54 AM
Possible Lookup Table Karen Excel Worksheet Functions 5 June 8th 05 09:43 PM


All times are GMT +1. The time now is 08:24 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"