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?
 

Some videos you may like

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.

Richard Schollar

MrExcel MVP
Joined
Apr 19, 2005
Messages
23,707
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
 

VoG

Legend
Joined
Jun 19, 2002
Messages
63,650
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
 

Watch MrExcel Video

Forum statistics

Threads
1,123,158
Messages
5,600,054
Members
414,357
Latest member
Gemma_R

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
Top