I have thousands of filenames listed in a worksheet in the following format:
Filename 1 (A101 8.2 S3)
Filename 2 (A5 9 R14B)
Filename 3 (A45 27 M24)
How would I use VBA to extract the last number and place in the adjacent cell (as below)?
Filename 1 S3
Filename 2 R14B
Filename 3 M24...
All -
Beginning coder attempting to write macro to attach to a CommandButton to store a selected file path (folder or file from MS File Explorer) into a specific cell "B2".
Currently having issues with the code below:
Sub GetFilePath2()
Dim filename As String
filename =...
OK, so I have a drop down in cell A1 to select the year and another dropdown in B1 to select the first part of a filename and a third dropdown in C1 to select the second part of the filename
So if select...
A1 = 2019
B1 = Donors
C1 = April
...and the file I want to open is...
Hi all,
I've found some VBA online to fulfill my requirements, but I cannot get it to work. Let me explain what I have and what I'm looking for:
I have ~150 .xlsx Workbooks, with the exact same format (which might be irrelevant):
Sheet1 row 1 is a header row.
Column A is a data validation...
Hi guys,
I have a problem, I made a Sub function that copies files to multiple folder.
its working fine except for one particular folder. I don't understand why it is keep copying 1 level below of target sub folder and the filename is changed to April - 1901-04-2019 <filename>.<ext>. All other...
Dim Path As StringDim Filename As String
Path = "C:\Report\"
Filename = Range("B4")
ActiveWorkbook.SaveAs Filename:=Path & Filename & ".xlsx", FileFormat:=xlNormal
I am self teaching myself VBA and have run into an issue. Despite spending a lot of time searching, I wasn't able to get this macro...
I am trying to have the file name, be made automatic as we save it
I would like this file to be named:
"Meriden Online 04-23-2019"
When finished
I keep getting a save as method failed error
here is what I have so far
Dim Path As String
Dim filename As String...
I have a report that I'm developing and want to email it automatically when it's ready. I know how to do most of it, but I'm having trouble with the Subject line within the email. I want the subject line to be the file name. Below is the code that I have right now, that works fine, that...
Hi everybody
Been away for a while but lucky enough to just get a new job, hoping someone can help me out a bit on the last part of a VBA project. Using Office 2010
I have been working on some code to save selected sheets in an excel workbook as a named PDF document. The name is a cell value...
There is a list of filenames at Column A, say File A1, File A2, File A3 ...
How to set the formula at Column B so that it can get the value of A1 of files
i.e. Cell B1 can get the value of A1 for filename at Cell A1;
Cell B2 can get the value of A1 for filename at Cell A2;
NB: the path...
I have code to import a .txt file into a table. I'm running into an issue where the filename begins with "Select " (note the space after Select). If there is no space after "Select" the code runs properly. This is clearly an issue with how the DoCmd.TransferText is processed and not the code...
Currently I am looping through all files in a folder to grab certain columns based on the headers and pasting them all to a new master worksheet.
Currently I have a hyperlink being pasted at the end of each "section" by offsetting column B by .Range("B" & Rows.Count).End(xlUp).Offset(, 1) .
I...
I have a workbook template that saves to a specific path and filename when the save button is activated. I'd like it to also save it as a .pdf to a different path with the same filename when the save button is activated. I hope that makes sense and I've posted this correctly... The existing...
Hello I have a macro that should loop through the sheets until it reaches the sheet named "HO". However it still tries to run the macro on this sheet.
Please can someone let me know where I have gone wrong.
Here is my code.
Sub Nursery()
Dim ws As Worksheet
For Each ws In...
My file is saving the entire name when it converts to a PDF. I am simply trying to get the .xlsb part to drop off. Can anyone help me understand how to code the removal of the .xlsb from the Filename or Populate the save as name as one I choose?
I want to use this base code.
Sub...
I need some help I am not sure why how to get this code to run I have tried a few different things, but I just want to be able to easily change the file directory via DIM
Directory = "C:\DATA"
FileName = "PRNT" & i & ".DAT"
DirFile = Directory & FileName
ActiveWorkbook.Queries.Add Name:="PRNT"...
Hi all,
Need help on macro to pull information from outlook.
I have gone through the previous threads but not able to customize the solution to suit my need. I have taken the code / file from following link "https://www.vishalon.net/blog/expor...-meta-data-into-excel/comment-page-3#comments" and...
where am i going wrong? I am getting error 1004 Application-define or object define error. I believe the error is when the "DO While" loop starts. Any help please? It doesn't highlight any code so I could use a hint.
The idea is to have a button in an Excel Workbook ("Do Stuff"), which opens...
Hi all,
I have been compain 100 files in one master file using VBA,
Sub GetSheets()
Path = "C:\Users\dt\Desktop\dt kte"
Filename = Dir(Path & "*.xls")
Do While Filename <> ""
Workbooks.Open Filename:=Path & Filename, ReadOnly:=True
For Each Sheet In ActiveWorkbook.Sheets...
Hi Team
Need a help on excel sheets consolidation from Folders.
I have folders created by city name( Mumbai, Chennai, Agra etc) and these City folders have 4-5 worksheets with different header, which i need to consolidate one master sheet with data and header line of each worksheets.
I have...
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.