Computer Hope

Software => Computer software => Topic started by: Brad Emerick on January 11, 2005, 08:54:28 AM

Title: Excel VBA setting column width
Post by: Brad Emerick on January 11, 2005, 08:54:28 AM
Hi all.  I am using columns B:E to print on 4" labels.  Different data goes in to three of these cells when the user runs the macro, and I use ".AutoFit" to set the cell width on these three columns.  Last of all, I want to set the width of column D so that columns B:E add to 4".  Using ".Width" differs from ".ColumnWidth", but neither of these give the pixel number (when compared to clicking the right side of the column on the column bar).
So how can I set the width of column D to equal 4 inches minus the sum of columns B, C and E?

Note: This spreadsheet will be opened on different users' desktops of which will have different screen resolutions than I have.

Thank you, Brad.