VBA-Modification

michelcr7

New Member
Joined
Jun 14, 2018
Messages
7
HI guys,

Below is my current VBA code, I need change a little bit, it't simply cope paste values of 2 sheets into new file with 2 sheet.
I would like to change naming convetion_Path, it should be name of current file, but just "Test_dd_mm_yyyy")

Also it; somehow possible to change data format in specifc column in sheets? I would like to change from Long data to short data, I have in one sheet one column with long date, and 2 columns in the second sheet.


HTML:
Sub mcrSet_All_Values_and_Save_XLSX()
    Dim w As Long
    Application.EnableEvents = False
    ThisWorkbook.Save
    For w = 1 To Sheets.Count
        Sheets(w).UsedRange = Sheets(w).UsedRange.Value
    Next w
    Application.DisplayAlerts = False
    ThisWorkbook.SaveAs _
      ThisWorkbook.Path & Chr(92) & _
        Left(ThisWorkbook.Name, InStr(1, ThisWorkbook.Name, Chr(46)) - 1) & Format(Date, "_yyyy-mm"), _
      xlOpenXMLWorkbook
    Application.EnableEvents = True
End Sub
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
I would like to change naming convetion_Path, it should be name of current file, but just "Test_dd_mm_yyyy")
What is the current name?
What is it doing now, and how do you need it to be different from what it is doing now?

Also it; somehow possible to change data format in specifc column in sheets? I would like to change from Long data to short data, I have in one sheet one column with long date, and 2 columns in the second sheet.
You can set the format of any columns to be anything you like. Just turn in the Macro Recorder and record yourself setting the column formats as you like, and you should have the VBA code that you need to incorporate into your current code.
 
Upvote 0

Forum statistics

Threads
1,213,546
Messages
6,114,251
Members
448,556
Latest member
peterhess2002

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