From: Kiwifella on
Hi there all you Gurus out there!
I have created a macro to create a unique invoice number in a work book, but
for my specific purpose, each time I create a new invoice number i want to
record this in a rolling register in a separate spreadsheet & workbook.
If i have another spreadsheet open I found I can do this, However not when
the 2nd (register/record) work book is closed. I tried recording a macro
whcih included opening the destination work book, but this would not run when
I trialled it.
Can I do this?
Alternatively, can i program excel in such a way that every time I open
workbook A, workbook B also automatically opens so that I can write to work
book B as a register/record?
Huge thanks for your help, if anyone does know, I am a begininer so please
be very specific. I don't know how to "write macro codes" as such, I have
just been recording macros the easy way.
Thanks
From: Dave Peterson on
You recorded macro should work ok.

Is there a chance that you didn't allow macros to run when you reopened the
workbook?

If you allowed macros to run, then you'll have to explain what didn't work in
greater detail.

And if you get your recorded macro to work, then you can rename it to Auto_Open
and that will run when your workbook opens (if you allow macros to run).

If you're new to macros:

Debra Dalgleish has some notes how to implement macros here:
http://www.contextures.com/xlvba01.html

David McRitchie has an intro to macros:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Ron de Bruin's intro to macros:
http://www.rondebruin.nl/code.htm

(General, Regular and Standard modules all describe the same thing.)

Kiwifella wrote:
>
> Hi there all you Gurus out there!
> I have created a macro to create a unique invoice number in a work book, but
> for my specific purpose, each time I create a new invoice number i want to
> record this in a rolling register in a separate spreadsheet & workbook.
> If i have another spreadsheet open I found I can do this, However not when
> the 2nd (register/record) work book is closed. I tried recording a macro
> whcih included opening the destination work book, but this would not run when
> I trialled it.
> Can I do this?
> Alternatively, can i program excel in such a way that every time I open
> workbook A, workbook B also automatically opens so that I can write to work
> book B as a register/record?
> Huge thanks for your help, if anyone does know, I am a begininer so please
> be very specific. I don't know how to "write macro codes" as such, I have
> just been recording macros the easy way.
> Thanks

--

Dave Peterson