Hi P Sitaram, That's great, thank you so much.
First I tried it on one sheet and it worked as you said. I then copied the same code with the same heading "sub line()" into each worksheet's own sheet module. This generally worked so that when, from any worksheet, I click on tools -> macro ->macros I get a whole list of macros, eg Sheet1.line, sheet2.line etc. I have to pick the correct one for that sheet and click on run. On some, but not all, I get a message "Subscript out of range". However, if I set view to pagebreak view and run the macro again it seems to work although for other sheets it works fine in normal view.
Also I am sure there must be a way of making the one macro apply to all the worksheets in the workbook without having to repeat it in each sheet's relevant sheet module - or am I expecting too much?
Two more questions if you are not too busy: Can I limit the extent of cell borders to be drawn, so that rather than running the full width of the worksheet they only run across cells at the pagebreak from say col D to col AH?
I also tried your macro for removing the lines, this worked fine provided that the pagebreaks remained in the same place. If I inserted a couple more rows, then it didn't work as the borders previously drawn were no longer at the pagebreaks. Can I do a macro to remove all horizontal lines from below a certain point, i.e. from below the column headings?
I do appreciate all your help, I'm a great fan of excel generally but have never previously got into vb. In the old excel 2a and even office 97 I used to write my own macro's directly but gave up when MS introduced vb as it seemed too difficult and I had no time to study up on it, but now I'm trying to get back into it and your help has been invaluable