#1   Report Post  
Posted to microsoft.public.excel.misc
gillj
 
Posts: n/a
Default Macro Problems

I am attempting to create a macro in Excel and am encountering problems.
The details are as follows:

The macro is for use in producing invoices, the template for which is set
up in Excel. The majority of my invoices use exactly the same wording, i.e.

Collect defective item and transport to our workshop
Strip item
Clean parts
Etc.

What has been happening is that when I run the macro it only prints the
first line unless I position the cursor in exactly the same cell as the
starting point when creating the macro. I actually need to be able to
commence the macro from any starting point.

I am not very familiary with Excel, but have discovered that my problem is
to do with relative references. However, I have tried recording a macro with
the
feature turned on, and then with it turned off, and the result is the same
each time.

A further problem which has nowoccurred is that when I press the €˜record
macro button, the stop recording toolbar which contains the relative
reference button no longer appears on the screen. Whats happened to it?
How do I get it back?

I would be grateful for any help on these issues as I have been struggling to
resolve them myself for some now.

gillj
  #2   Report Post  
Posted to microsoft.public.excel.misc
mrice
 
Posts: n/a
Default Macro Problems


You have hit upon the major limitation of recording macros, you have to
do exactly the same thing each time. By manually editing the macro you
have recorded or by writing one from first principles, you can overcome
this limitation. There are some examples on my download page which show
what a non-recorded macro might look like.

In you particular case, I would suggest that you look at the macro code
(ALT F11) and you add a new line to the beginning just after the Sub
Macro1 line.

Range("A1").Select

This will work assuming that A1 is the cell that has to be selected in
order for the macro to work properly.

The effect of this line is to mimic the action of selecting the cell.

I hope that this helps.


--
mrice

Research Scientist with many years of spreadsheet development experience
------------------------------------------------------------------------
mrice's Profile: http://www.excelforum.com/member.php...o&userid=10931
View this thread: http://www.excelforum.com/showthread...hreadid=539504

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
Editing a simple macro Connie Martin Excel Worksheet Functions 5 November 29th 05 09:19 PM
Closing File Error jcliquidtension Excel Discussion (Misc queries) 4 October 20th 05 12:22 PM
macro with F9 Kenny Excel Discussion (Misc queries) 1 August 3rd 05 02:41 PM
Make Alignment options under format cells available as shortcut dforrest Excel Discussion (Misc queries) 1 July 14th 05 10:58 PM
Playing a macro from another workbook Jim Excel Discussion (Misc queries) 1 February 23rd 05 10:12 PM


All times are GMT +1. The time now is 03:59 AM.

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"