Take the 2-minute tour ×

I want to print a row in Excel. One row contains data for one project.

I want to print one row on one page nicely formatted. Meaning the value of one cell is the header and should be printed fat and centred, the other values should also be placed at fixed positions on the page.

Is this with VBA possible? When I was searching for this problem I only found results for printing a worksheet or a table or parts of it, but no results to use the values of the cells and formatting them.

Thanks in advance

share|improve this question
If you only need to print some value to a cell and give the cell some formatting, you can simply record a Macro, do it manually, then use the recorded VBA code. –  KMC May 11 '12 at 10:08
does it have to be in VBA? you can create a sheet as a template for printing with formulas like =INDIRECT("sheet1!A"&row_number), create a named range called "row_number" and enter here the row number you want to print... –  deathApril May 11 '12 at 10:17
add comment

3 Answers

up vote 0 down vote accepted

As the other answers indicate, it is certainly possible in Excel VBA, but it is not really Excel's strong point.

What would typically be done to obtain the result you seem to be after is use a fully formatted Word document with fields that are then filled in with values from an Excel worksheet. You can even cheat a bit and use the Mail Merge \ Letter wizard to set everything up.

If you do want to do it all in Excel, you can find instructions and an example VBA macro here: http://www.tek-tips.com/faqs.cfm?fid=4223

share|improve this answer
add comment

Template is a good way to do. With a macro there's better performance where it avoids the usage of volatile functions such as INDIRECT() However again it depends on how many volatile functions your worksheet carries.

share|improve this answer
add comment

Yes, it is possible when you use the Styles in excel. I know you can do Font formatting quite easily. Not sure about indenting it, but worth a try.

If style doesnt support it (it might in Excel 2010), you can always indent it via VBA (record a macro when you indent the values , it should look like this):

Selection.InsertIndent 1

share|improve this answer
add comment

Your Answer


