String extract and save as

gripper

Board Regular
Joined
Oct 29, 2002
Messages
176
Hello everybody.

I was hoping to get assistance on writing code within a macro to do a two step process. My macro works well in gathering the data but I need to do two more steps which I am unclear on.

The workbook after the macro runs has two sheets 1 = “Combine Sheet” and 2 = “Logged Data”.

On the logged data sheet I have the following file path in cell A8.

C:\raw_data\businessdocument.new\businessfinancemodel.new_Matrix_Insurance.csv

I would like to leave this data in place but copy the info between the 2nd backslash and the third backslash to read “businessdocument.new” and place that in cell B2.

My issue is I cannot figure out the code to extract this piece of data.

And my second step is I would now like to save this document as “c:\installer\newbusiness\businessdocument.new.csv”

So basically add a string to the beginning of what is in sheet “Logged Data” cell B2 and then save it as a .csv file and not an xlsx file. I am using Excel 2007.

Is there a possibility of doing this automatically without me having to click on the saveas file browse window.

I have to do a lot of these sheets and if I can just fly though these it would be great.

I appreciate in advance all your assistance.
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.

Forum statistics

Threads
1,224,590
Messages
6,179,756
Members
452,940
Latest member
rootytrip

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