View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Steved Steved is offline
external usenet poster
 
Posts: 519
Default using VBA remove "0" but leave "X" first digit only please.

Hello from Steved

The below works as I require so what would I need to do please to have it
put in VBA and look in Col B:B to remove "0"

The below deletes the first digit if it is a "0" but leaves "X"

for example 0701301 it will become 701301 but if it has X701301 it will
ignore and find the next cell in Col B:B with "0"

=MID(B2,1+(LEFT(B2)="0"),99)

i THANKYOU


"Steved" wrote:

Hello from Steved

Col B:B
Column format is General
0702301 to become 702301 but if it has an X702301 please ignore
Yes I'm only requiring the first digit of the cell to be changed ie delete
"0" if it has an "X" ignore it and find the next "0"

The bottom is similar as to what I'm trying to acheive please
Sub removezero()
Range("B2:B250").Formula = "=required Formula please"
End Sub

Thankyou