Removing 1st character in a string

bobkap

Active Member
Joined
Nov 22, 2009
Messages
313
Office Version
  1. 365
Platform
  1. Windows
  2. Mobile
  3. Web
I have a column of different 3-digit numbers that are preceded by the "#" sign. I want to remove just the # sign. I've listed the code below that I am using. Every time I run it, it does remove the # sign, BUT it also replaces the 3-digit number with some single digit arbitrary number that does not contain any of the same digits as the original number. Staring at this for over an hour now does not seem to fix the problem. :) Any help would be greatly appreciate.

VBA Code:
bk4 = Application.match("Item #", Range("1:1"), 0)
finalrow = Cells(Rows.Count, 1).End(xlUp).Row
For counter5 = finalrow To 2 Step -1
Cells(finalrow, bk4) = Left(finalrow, 1)
finalrow = finalrow - 1
Next counter5
VBA Code:
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Please post a sample of your data and expected output.
 
Upvote 0
Try
VBA Code:
Cells(finalrow, bk4) = mid(Cells(finalrow, bk4),2)
 
Upvote 0
Solution
Cells(finalrow, bk4) = mid(Cells(finalrow, bk4),2)
THAT DID IT!! You've saved the day again. Thanks very much. I just wished I could figure some of these things out myself. :)
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0
I would think these two lines of code is all you need...
VBA Code:
  bk4 = Application.Match("Item #", Range("1:1"), 0)
  Range(Cells(2, bk4), Cells(Rows.Count, bk4).End(xlUp)).Replace "#", "", xlPart, , , , False, False
 
Upvote 0

Forum statistics

Threads
1,214,998
Messages
6,122,638
Members
449,093
Latest member
Ahmad123098

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