Excel Questions

I am trying to create an excel spread sheet (report for the user in LotusScript) and I have found a ton of examples but the one I am trying to create is very complex so I have some questions.

The first 3 col headers are normal but the middle ones are rotated 45 degrees (both text and lines). I found how to rotate text on an entire line but how do I do that with a range of cells

Also how do i make a set of cells stationary (as user scrolls the header needs to be stationary)

I am sure I will have more as it seems a lot is trial an error and I really dont know Excel very well.

Thanks for any help,

Mark

Subject: Excel Questions

As Rob said the easiest way would be to record a macro and use the code.Probably most of the things You will need to change are the excel constants (xlRight, xlBottom). Use the link in this post → http://www-10.lotus.com/ldd/nd6forum.nsf/55c38d716d632d9b8525689b005ba1c0/28fe4d20aa7927f1852570ac00495e5a?OpenDocument for a notes db with excel/word … constants.

Also:

  With Selection

    .HorizontalAlignment = xlRight

    .VerticalAlignment = xlBottom

End With

wont work I think. Use instead:

ExcelSheet.Selection.xxxxxxx

Hope it helps!

Subject: Excel Questions

If your column headers are in row 1 of your spreadsheet than this is what you need to do.

click inside cell A2, go to ‘Window’ on your toolbar and select ‘Freeze Panes’

Thats it!.. you should see a thin black line appear underlining the first row… meaning that row has been frozen

To unfreeze that row simply click back in cell A2 and select ‘Window’ and ‘Unfreeze Panes’

Basically whater row you want froze make sure the cell directly under that row in column 1 is selected, or whatever column you want stationary make sure the uppermost cell to the right of the column is selected… then use your window / freeze,unfeeze.

Subject: RE: Excel Questions

oh sorry… to answer your other question about rotation,

follow these steps:

  • right click on the cell that holds the text you want to rotate

  • select ‘format cells’

  • click the ‘alignment tab’

  • use the orientation mover thing to select your desired degree for the text… or you can use the degree up and down arrows or manually type in the degree

Subject: RE: Excel Questions

I see this is going to be a royal pain but the macro is helping. Would be nice if you could cut n paste verbatim!

Thanks for the help

Subject: Excel Questions

The easy way is to create a template of the Excel file that you want to build. Predefine both the headers and the locked section (as described in the previous response). Use this template as your new spreadsheet and start populating your data on whatever row you want.

If you do it this way, you eliminate the need to learn how to program Excel from LotusScript and can concentrate on how to add data to the sheet instead.

Subject: RE: Excel Questions

I need to do this in LS not from the Excel application. This SS could be used by anyone. I need to know how to do this in code please. Everything will be in code not on the SS. I also dont have the ability to put a template so it has to be created on the fly.

Mark

Subject: RE: Excel Questions

I think your best bet is to go into Excel itself and record a macro of you manually manipulating the sheet to do what you want.

Then paste the Visual Basic script that it creates into your LS pane. You’ll need to change a few things but it is by far the easiest way to get at some of the more obscure functionality.

HTH, Rob