Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I'm working on a price quotation template and I need some help. There is a cell call it F4 that has the quotation reference number in it. What I want to do is create a marco that runs when the template is opened that automatically inserts concatenated data that is the 'system date' & "-" & (here's the kicker) the count of the number of files in a given folder plus 1 in a ### format. For instance, take today and there are 10 quotes in the folder, the cell would display "38387-011". Is this possible, and if so how? Sincerely, Josh Hallenbeck |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
http://support.microsoft.com/default...b;en-us;165639
here is a link to how to count files in a directory "Josh" wrote: Hi, I'm working on a price quotation template and I need some help. There is a cell call it F4 that has the quotation reference number in it. What I want to do is create a marco that runs when the template is opened that automatically inserts concatenated data that is the 'system date' & "-" & (here's the kicker) the count of the number of files in a given folder plus 1 in a ### format. For instance, take today and there are 10 quotes in the folder, the cell would display "38387-011". Is this possible, and if so how? Sincerely, Josh Hallenbeck |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() "Josh" wrote in message ... : Hi, : : I'm working on a price quotation template and I need some help. There is a : cell call it F4 that has the quotation reference number in it. What I want : to do is create a marco that runs when the template is opened that use the open event for ThisWorkbook Private Sub Workbook_Open() 'your code here End Sub : automatically inserts concatenated data that is the 'system date' & "-" & for the 'system date' in excel style strSerial = (Date - DateSerial(1900, 1, 0)) + 1 : (here's the kicker) the count of the number of files in a given folder plus 1 sorry I don't have time to code for you but look into FileSystemObject getfolder, etc. to find the number of files in a specific directory : in a ### format. take your count of files, then use an if to determine how to make your string i.e. if <10 then "00" & CStr(count + 1) else if < 100 then "0" & ... :For instance, take today and there are 10 quotes in the : folder, the cell would display "38387-011". now combine strSerial & "-" & strCount : Is this possible, and if so how? : : Sincerely, : : Josh Hallenbeck |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Auto Fill Down Macro | Excel Worksheet Functions | |||
Look up field and auto fill the rest | Excel Worksheet Functions | |||
Take part data from two fields and auto fill into 3rd field | Excel Worksheet Functions | |||
Recording Macro to auto-fill | Excel Discussion (Misc queries) | |||
Macro for Auto Fill | Excel Discussion (Misc queries) |