Excel Export from Access via VBA changing Row Height - excel

I'm trying to export a query from Access to Excel and I can do so successfully. However when I open the document, the row height on almost all the rows has increased to contain the text they contain (which wrapped). This requires the rows and columns to be manually adjusted to get the rows back to the default height.
Is anyone aware of a way to expand the columns when exporting to Excel rather than the rows?

If you turn off the "Wrap Text" option for the cells the text will not expand the row height. Is there any reason you can't select all of the cells and change the row heights all at once?

Related

Add border to cells in a table if another row is added in excel

I have an Excel spreadsheet which spans columns A to T and for ease of reading, the cells have borders. Currently when another row of data is added to the spreadsheet though, I, or other users, have to add borders around the cells, just for cells in columns A to T where is something (usually, but not always, a date) in Column B on that row. The spreadsheet is a log of survey results, and gets very long by the end of the year, but doesn't have a defined number of rows, because it's being added to all the time. It's not much of a problem for me to add borders, but other users not familiar with Excel either manage to add borders to all the cells in columns A to T making the end of the list look untidy with cells with borders but no contents or they just don't bother adding borders and it gets very messy for managers to read (apparently!).
I'm trying to use conditional formatting with a formula to format the cells, but can't seem to get the formula right. I'm basically trying to get Excel to add a border around cells in columns A to T on any row where the cell in column B on that row isn't empty. I've tried various formulas with no luck so far and just end up with borders everywhere but where I want them!
Some of what I've tried so far (I can't remember all the ones that didn't work!):
(row 4 is the first row of data)
=$B2<>"" (applied to =$A:$T) (adds borders above the table, but not below)
NOT(ISBLANK($B4)) (applied to =$A:$T) (doesn't add any additional borders)
=B4<>"" (applied to =$A:$T) (doesn't add any additional borders)
=not(exact(B4, "")) (applied to =$A:$T) (doesn't add any additional borders)
...and of course using Excel's inbuilt "cell doesn't contain a blank value" doesn't allow you to specify that you want to know if another cell isn't blank. It'll add borders around cells after you've input into them, but if a cell in another column is blank for any reason, it leaves 'holes' in the table where there aren't any borders which makes it look even more messy.
Am I just fundamentally misunderstanding the formulas, or can this not be done? (or do I need VBA to do this?)
Your formula needs to refer to the first row of the Applied To area:
=$B1<>""
And apply it to =$A:$T

Slicer is changing row heights of my pivot table?

I want to apply a slicer to my pivot table so users can filter easily, but whenever I select something, the row heights change. I have 'Autofit column widths on update' unchecked and 'Preserve cell formatting on update' is checked'.
Any ideas would be greatly appreciated!
I was able to figure this out by changing the font size of an empty column outside of my PivotTable to fit the row height I wanted. For example, I want my row height to be 30, so I changed an empty column's font size to 24. When I applied my slicer, row heights looked fine!
Is the Wrap option perhaps set for cells in the pivottable?
The answer marked as correct didn't work for me, but got me on the right track.
Check to see if there are cells anywhere on the same row as the cells that are automatically changing height which are of a larger font size. In my case, I had hidden cells (columns) to the right of my pivot table which were 8 pts larger than the cells in my pivot. The pivot table was adjusting the height to accommodate the other cells outside of the pivot table which happened to be hidden from my view so I couldn't see them.
Just had and resolved the same problem on my workbook. For me, it's related to the formatting in a table header NEXT to the the pivot table being set to Wrap Text. Unwrapping the header in the adjacent table fixed the problem.
Basically every time I updated the slicer, Excel tried to resize the header in the adjacent table to what it thinks is the proper fit.

Autofill handle behaving differently in two columns

I'm working on a spreadsheet where values entered in two columns will often (but not always) be the same for the entire column. When dragging down the column with the fill handle, however, one column copies data and the other increments it and I don't understand why. The column that increments is also copying borders down the column, the other column isn't. Under the formatting window both columns have the exact same settings (other than background color, but I tried changing that and it had no impact), why is it behaving this way and is there any way to change the default behavior for each column?
Note: I've tried ctrl+dragging the columns, and the "Extract Volume" column copies values correctly, but still is copying borders while the "Dilution" column is just copying values.
Before dragging handle:
After dragging handle:
Enter 50 in the first two rows of Extract Volume and then drag it down that should work.
I have a feeling that the datatypes for both columns are different and that's why you're getting this error.
Another approach is, Enter 50 in the first row, Copy it, highlight the rows you wish to fill and paste.

Excel: Copy formatted data fast

This is a excel question:
I have a excel sheet which is heavily formatted, that is, the column widths have been changed and the cells have color formatting. I have filtered this sheet on certain fields. Now, I want to copy this filtered data to another excel sheet with all the formatting.
So for the only way possible seems like to copy the formatting first using paint formatter one by one for each column but that is very tedious. Is there a simple way to do this?
Copy what you want, then paste special three times into your target range: values, columns widths, formats.
Edit: Changed order, putting widths before formats. Otherwise wrapped cells will incorrectly change row height.
To copy the cell values and the formatting use the Camera Tool. This is available on the Command Tab of the customise menu. This Camera Tool copies the cells as a graphic and is dynamic.

change the height of a rows in excel when hundreds have been set to 0

I have an excel spreadsheet with a list of hundreds of users. A lot of the rows have been set to height 0. I want to set all of them to the same value so I can see all of them. I'd rather not have to go through every row and drag the ones with height 0 down so I can see them.
What do I do?
Mark all cells and double click when the resize icon is visible over the columns.
Assuming you are using 2003 or 2007:
Highlight all of the rows.
Right-click over top of one of the row numbers.
Click the Row Height menu item and set it to your desired height.
Select any cell in the data range, then Ctrl+Shift+L(apply data filter).
All rows with zero row height will appear.
Can use Ctrl+Shift+L to trigger data filter off.

Resources