Adding a title after spreadsheet and macros are written - excel

I have been making a spreadsheet with sorting macros for my work for about the past week. I finally finished up the coding(98% of it) and my boss now tells me I need a title at the top of the spreadsheet when it prints. All of the codes I have written error when I shift the data down in order to add a title in row 1. Is there a way to add a title without having this happen? I'm a novice with VBA all around and recieved a decent amount of help with this project so bear with my ignorance please! Thanks in advance.

You can use the Page Header settings to add a title, without affecting the rows themselves.

If you have a worksheet object called sheet, you can set its header in code using the PageSetup property:
sheet.PageSetup.CenterHeader = "Centered Title"
You can also control the left & right headers and center/left/right footers like this.

There is no need for VBA. Simply add a header to your document. Go to Insert, Header and Footer.

Related

How do I take the title of a website and add it to an Excel spreadsheet using AppleScript + Excel

I'm pretty sure this is an easy task, but I can't seem to find what I'm looking for.
In short, I would like to use a keyboard shortcut take the title of the current page I'm on, and save it to an Excel document, basically creating a log of websites. If possible, I would like to add a link to the title that is saved in Excel.
I know how to add the Applescript as a service or workflow and such, but I can't wrap my mind around how to code this. The farthest I've gotten is grabbing the name of the website, but have no clue how to paste it to Excel, add a link to the title, then go to the next line.
Thank you for any assistance you may have.
Try these two lines of AppleScript
tell first document of application "Safari" to set pageTitle to name
tell first document of application "Safari" to set pageURL to URL

To make entire row mandatory to fill if one cell of that row is filled

For ms Excel 2007.
I want the user to fill all cells in a row IF any one cell of that row is filled.
I am using ms-Excel 2007.
The only way I can think of to do this is by using a form. The form would have to be the only way that the user can enter data (you protect the worksheet and the form code "unprotects" it), then when the user fills out the form you check the fields for errors (not just omissions, but things like "that is not a valid date", etc).
To see what I mean, you can see a form at work for data entry in this tutorial. Maybe that's all you need, although there's not really solid data validation built in. But it will get you started.
Once you see how that works, you can try to design your own form that replicates the functionality of this one, but that includes error trapping. This involves opening the VBA editor (<Alt-F11>), inserting a user form, adding fields and buttons, and writing some code that is run when the "OK" button is clicked.
Not saying this is an easy thing to implement (I am guessing from the question that you may be new at this), but give it a shot. When you get stuck - post an update to your question or leave a comment.

How to change the result of exporting to Excel format a report with subreport and chart

We have a report which contains 6 pages (I have used page breaks). Each page has few sub-reports and few charts. We are exporting it as Excel.
When we are trying to print one sheet the page is breaking into multiple pages dividing the sub-reports and charts in middle. Is there some best way or thumb rule to follow in order to make reports print friendly.
On the Ribbon (I have Excel 2007) go to View tab, then select Page Break Preview and drag page borders as you desire. These settings are saved together with the workbook, so on the next reopen page breaks will remain as set.
Finally found the answer.
Posting here in case somebody is struck with same issue
Need to set these properties in report
net.sf.jasperreports.export.xls.fit.width =1 and
net.sf.jasperreports.export.xls.fit.height=1.
Thanks

form view in excel for a record

I have a sheet in excel that is basically like a database (yes it has to be in excel unfortunately) and I want to design a simple form to display the records (the different column values in the rows). Usually MS is good with making widgets to do this but I cant seem to figure out how to write it in VBA (easily)
Basically I have a list of Names and ID#'s then some other columns that need to be filled in (address, order # etc) but I'd like the user to do this via a form rather than typing in excel. I created a small form in VBA, but now I cant link the columns to the textboxes in the form.
Anyone know of any code I can plug and play to do this.
Specifically I am using a ComboBox (for the list of names) and then a for loop searching through it to find the selection and updating data. But its a real pain.
plus I cant figure out how to put in a 'Next' button, which is really annoying me. Does anyone know how to change the comboBox value to the next row, if it is linked via RowSource
Have you considered the Form feature? You can find under the commands you can add to your QuickAccess toolbar.
Check this helpful tutorial for additional details.

What does EMBED function mean in Excel Controls?

I am adding a button in an existing Excel file. I noticed that the existing buttons has the EMBED formula specified to it. What does the function mean?
=EMBED("Forms.CommandButton.1","")
Honestly there really is not much documentation available on this "function". It is one of those things which are exposed unnecessarily when it really shouldn't have been. We are not supposed to enter this manually.
When you select a CommandButton and place it in Excel, you will see
=EMBED("Forms.CommandButton.1","")
in the Formula Bar. This text is necessary and should not be deleted. It is Excel's way of telling itself that an object has been inserted.

Resources