Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Hi! All,
Is it possible to rename.PDF file name using excel Sheet? Basically, we are working in Tally, and we need to generate Sales Invoice from Tally, and by default, tally save the invoice from Sales Invoice Number(Sales-101), and as per client requirement, they need Invoice number with Party Name (Sales-101-ABC), we have 2300 Ledger, and on daily basis we are generating 500 Sales Invoices. PDF file saved in (D:\INVOICE PDF-TALLY\PDF), and I need to rename files in this folder and save to another folder (D:\INVOICE PDF-TALLY\PDF rename) with updated File name. My excel file location (D:\INVOICE PDF-TALLY\Sales Invoice Master.xlsx) file name €śSales invoice Master€ť, Column A have old File name and Column B have New File Name (Need to replace with Old Name) Thanks in Advance |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
hardeepkanwar75 wrote:
Is it possible to rename.PDF file name using excel Sheet? Basically, we are working in Tally, and we need to generate Sales Invoice from Tally, and by default, tally save the invoice from Sales Invoice Number(Sales-101), and as per client requirement, they need Invoice number with Party Name (Sales-101-ABC), we have 2300 Ledger, and on daily basis we are generating 500 Sales Invoices. PDF file saved in (D:\INVOICE PDF-TALLY\PDF), and I need to rename files in this folder and save to another folder (D:\INVOICE PDF-TALLY\PDF rename) with updated File name. My excel file location (D:\INVOICE PDF-TALLY\Sales Invoice Master.xlsx) file name €śSales invoice Master€ť, Column A have old File name and Column B have New File Name (Need to replace with Old Name) You will need to use VBA to do this. This copies the files: Sub renamer() Dim L0 For L0 = 1 To Cells.SpecialCells(xlCellTypeLastCell).Row FileCopy "D:\INVOICE PDF-TALLY\PDF\" & Cells(L0, 1).Value, _ "D:\INVOICE PDF-TALLY\PDF rename\" & Cells(L0, 2).Value Next End Sub If you really intend to move them, replace the FileCopy line with this: Name "D:\INVOICE PDF-TALLY\PDF\" & Cells(L0, 1).Value As _ "D:\INVOICE PDF-TALLY\PDF rename\" & Cells(L0, 2).Value All of the above assumes that columns A & B do *not* contain paths, only filenames. (If the paths are included in the cells, simply delete them from the code above.) -- I've got a really terrible terrible feeling about this custard tart. |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
On Thursday, January 12, 2017 at 4:53:39 PM UTC+5:30, wrote:
Hi! All, Is it possible to rename.PDF file name using excel Sheet? Basically, we are working in Tally, and we need to generate Sales Invoice from Tally, and by default, tally save the invoice from Sales Invoice Number(Sales-101), and as per client requirement, they need Invoice number with Party Name (Sales-101-ABC), we have 2300 Ledger, and on daily basis we are generating 500 Sales Invoices. PDF file saved in (D:\INVOICE PDF-TALLY\PDF), and I need to rename files in this folder and save to another folder (D:\INVOICE PDF-TALLY\PDF rename) with updated File name. My excel file location (D:\INVOICE PDF-TALLY\Sales Invoice Master.xlsx) file name €śSales invoice Master€ť, Column A have old File name and Column B have New File Name (Need to replace with Old Name) Thanks in Advance I am getting the error "FILE NOT FOUND" Sub renamer() Dim L0 For L0 = 1 To Cells.SpecialCells(xlCellTypeLastCell).row Name "D:\INVOICE PDF-TALLY\PDF\" & Cells(L0, 1).Value As _ "D:\INVOICE PDF-TALLY\PDF rename\" & Cells(L0, 2).Value Next End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Rename sheet if current sheet name exists | Excel Programming | |||
Rename active sheet with current file name | Excel Programming | |||
rename current file save and delete original | Excel Programming | |||
Rename file based on current date | Excel Programming | |||
Rename current sheet | Excel Programming |