Deleting 1st character in a cell using VB..

da_vide78

Board Regular
Joined
Mar 6, 2007
Messages
73
I am absolutely brand new at VB and learning very slowly so need some guidance with the below problem.

I'm after some code which will look at cell in Column F and delete the 1st character from it, leaving the rest. Another dimension to this is, rather than the code look all the way down to row 65,000 it stops at the last populated row.


Any ideas?
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Code:
Dim rng As Range
For Each rng In Range("F1",Cells(Rows.Count,"F").End(xlUp))
  If Not IsEmpty(rng) Then rng.Value = Mid(rng.Value,2)
Next rng
 
Upvote 0
Try

Code:
Sub trnc()
Dim LR As Long, i As Long
LR = Range("F" & Rows.Count).End(xlUp).Row
Application.ScreenUpdating = True
For i = 1 To LR
    Range("F" & i).Value = Right(Range("F" & i).Value, Len(Range("F" & i).Value) - 1)
Next i
Application.ScreenUpdating = True
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,833
Messages
6,121,868
Members
449,053
Latest member
Mesh

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top