Manipulate String format

apo

Well-known Member
Joined
Nov 3, 2008
Messages
581
Hi..

I have been trying to crack this for a day now.. any help would be greatly appreciated.

I have a column of Descriptions (Column C). These are all descriptions of PDF Filenames.

I am trying to make a Macro where each Description in Column C is looked for on my hard drive and the row highlighted yellow if it finds the file.

I have got the part where it looks on my hard drive and then colors the row yellow done fine... the issue i am facing is that the Descriptions entered in Column C quite often don't have the exact correct filename.

Example:

BH100212.2-12.48_UCS-samplesent_awaytoABTF

Should search for:

BH100212.20-12.48_UCS-samplesent_awaytoABTF



BH10037.3-7.55_UCS-samplesent_awaytoABTF

Should search for:

BH100307.30-07.55_UCS-samplesent_awaytoABTF


Basically.. after the first 6 characters.. the format then needs to be xx.xx-xx.xx

The leading zeros must be present so the search matches up with the filename..

Anyone got any idea how to manipulate those numbers after the first 6 characters so they get the zeros added?

<tbody>
</tbody>

<tbody>
</tbody>

<tbody>
</tbody>


<tbody>
</tbody>
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
yes I can think on how to manipulate but I do not think you can came with an algorithm to guess if zeros are trailing or ending 2-> 20 and 7 -> 07
Sergio
 
Upvote 0

Forum statistics

Threads
1,214,922
Messages
6,122,281
Members
449,075
Latest member
staticfluids

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