Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 103
Default Macro Auto-Fill Field.

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,560
Default Macro Auto-Fill Field.

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 92
Default Macro Auto-Fill Field.


"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
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
Auto Fill Down Macro Angela T Excel Worksheet Functions 5 November 17th 09 07:01 PM
Look up field and auto fill the rest [email protected] Excel Worksheet Functions 4 April 2nd 09 04:55 PM
Take part data from two fields and auto fill into 3rd field Kevin K Excel Worksheet Functions 1 August 26th 08 04:03 PM
Recording Macro to auto-fill Zee Excel Discussion (Misc queries) 1 July 2nd 08 11:12 PM
Macro for Auto Fill carolini Excel Discussion (Misc queries) 2 December 6th 05 09:11 PM


All times are GMT +1. The time now is 01:54 PM.

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

About Us

"It's about Microsoft Excel"