VBA Excel - find value within string and replace

ArtyS20

New Member
Joined
Oct 1, 2020
Messages
12
Office Version
  1. 2016
Platform
  1. Windows
Hello:

I need to delete part of a string but given that the common character (semicolon) repeats multiple times, I'm unable to come with a formula/code that can be used in vba.

Column B contains a series of characters similar to this - ;2;1;3;2;321;1;TEST 2022;2;35047.309637; - where the length is variable. What I need to do is obtain the value within the last set of semicolon. In this example - 35047.309637 - will be the final value I want to see.

Column B is populated sometimes and some other times is blank. Range of rows varies and it is defined by Column A.

Any help is appreciated, thanks.
 
You're welcome. Might as well mark this one as solved.
 
Upvote 0

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
and for having the solution with the most code lines!
I am always amazed at how much people sometimes get hung up on that. As you know, sometimes less lines is better but not always, and not necessarily.

I often purposely have more lines, breaking things out into "bite size" pieces that beginners can understand better what they steps are and what the code is doing (and why I often add documentation to the code).
I have seen some pretty complex code that is only a few lines long, as everything gets crammed together in just a few lines with lots on embedded calculations.
It may be cool and short, but most of the time the OP has no idea how it works, so they get an answer, but often times don't learn anything, and often run into trouble if something doesn't work quite right and it requires editing.
 
Upvote 0

Forum statistics

Threads
1,214,936
Messages
6,122,340
Members
449,079
Latest member
rocketslinger

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