Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 538
Default 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.
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default 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
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Rename sheet if current sheet name exists Ron5440 Excel Programming 7 January 7th 10 09:55 PM
Rename active sheet with current file name [email protected] Excel Programming 5 July 11th 06 11:29 AM
rename current file save and delete original valve79 Excel Programming 0 January 13th 06 10:17 PM
Rename file based on current date wira Excel Programming 1 April 29th 05 10:37 AM
Rename current sheet No Name Excel Programming 3 May 20th 04 09:23 PM


All times are GMT +1. The time now is 08:52 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"