Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Copy to an existing wb or create new wb if it does not based on ce

You have two choices ( or due both).

1) check if the file exists using DIR(filename)

FName = dir(Filename)
if FName = "" then
'file doesn't exist
else
'file does exist
end if

2) Check column A for customer
Customer = Range("D5")
set c = Columns("A").Find(what:=Customer, _
lookin:=xlvalues, lookat:=xlwhole)
if c is nothing then
'customer doesn't exist
else
'customer does exist
end if

"winnie123" wrote:

Hi

If I had a customer name in Cell D5, which has been selected from a
validation list is it possible to

1. check a summary sheet to see if the file already exists and if so add
data to the next available row. The summary sheet would have the customer
name in A4 downwards, B4 downwords would be the hyperlink to the file.


2. use that customer name to create a new file, would need to copy header
row as well as data. Then update the summarry sheet to include the new
Customer name and file path.

At the moment I have a macro from RDB which copies all unique vales into new
workbooks and creates this summary page with the hyperlinks.
As more records gets added it may mean that the macro is creating 300 files
which will take time. So I am looking at just adding the new reord to the
existing file or create new.

Any help and advise would be appreciated as always.

Thankyou
Winnie

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
Create new records from existing ones based on 'rule'? msnyc07 Excel Worksheet Functions 1 May 28th 10 02:38 PM
Macro to create a new tab based on an existing tab Maypop Excel Programming 1 January 7th 09 01:37 PM
create named worksheet based on existing numeration SteveDB1 Excel Programming 3 February 25th 08 03:45 PM
Macro to create a new worksheet that is a copy of an existing one? Kai Cunningham[_2_] Excel Programming 3 July 3rd 07 02:30 AM
Dynamically create worksheets in Excel based off existing data? tlozier Excel Discussion (Misc queries) 1 September 10th 05 12:25 AM


All times are GMT +1. The time now is 11:35 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"