VBA code to perform an advanced trim, on the last rown entry

tommodaniels

New Member
Joined
Dec 19, 2008
Messages
10
Hi all,

I think I have something which could challenge your expertise so here it is.
<o:p> </o:p>
I need some VBA code that always navigates to the last populated row of a s/sheet and then checks column B for a percentage value. It seems that the data in column B will appear as (e.g) 99995544 HAR:5.95%LLM. So I guess I need something which identifies the percentage sign and then extracts this and any numbers left of the percentage sign, to another sheet.
<o:p> </o:p>
To take this one step further if at all possible. I need the code to actually cycle through the rows and when it reaches column A where dd.mm.yy is equal to yesterday’s date, it moves to column b of that row and performs the percentage value extraction.
<o:p> </o:p>
I have no ideas where to start with this so your answers are much appreciated.
<o:p> </o:p>
Many thanks
<o:p> </o:p>
T
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Hi,

Welcome to board!

It's Formula based approach.

I used a helper cell

In E1,

=INDEX($B$2:$B$35,MATCH(TODAY()-1,A2:A35,0))

In E2:

=MID(E3,FIND(":",E3)+1,SUM(FIND({":","%"},E3)*{-1,1}))+0

I assume that there will be a ':' before the percentage.

HTH
 
Upvote 0

Forum statistics

Threads
1,215,011
Messages
6,122,680
Members
449,091
Latest member
peppernaut

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