ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Rename Current PDF file name using Excel Sheet List (https://www.excelbanter.com/excel-worksheet-functions/453048-rename-current-pdf-file-name-using-excel-sheet-list.html)

[email protected]

Rename Current PDF file name using Excel Sheet List
 
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

Auric__

Rename Current PDF file name using Excel Sheet List
 
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.

[email protected]

Rename Current PDF file name using Excel Sheet List
 
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


All times are GMT +1. The time now is 03:29 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com