Auto adjust row heights based on specific column

mirobers

New Member
Joined
Feb 15, 2024
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Hello,
I am still fairly new to VBA and I'm trying to write a code that will auto adjust row height based on the contents in column D. Many cells in column D contain multiple lines of text with 'alt+enter' used to separate them. I would like to set the minimum row height to 24 (and I would like to default to 24 if the cell in column D is empty). I have been trying to use Chat gpt to help me, but I can't quite seem to get there - I think it's struggling to figure out the best way to calculate height based on what's happening in column D. Any help would be greatly appreciated!!
4140 Univeristy Estimate.xlsm
ABCDEFGHIJKLMNOPQR
1HIDE COLUMNS TO PRINT
2
3
4
5
6
7
8
94140/4142 University Addition Remodel
10
11Print Date:
12Internal Notes Material Cost Quantity Carpenter DAYS Carpenter HOURS Painter DAYS Painter HOURS Mgmt HOURS Labor Cost
13Pre-Construction and Site Management
14Architectural PlansN/A; all architectural planning and renderings will be completed by homeowner/other. ***We're estimating around 0 hours of time, split between Travis on the structural/technical side and Liz on the layout and finishes. Any hours beyond 0 will be billed in addition, but we will notify the clients once we are approaching the number. This assumes cooperation from the architect so that we aren't starting from scratch on building the CAD files and dimensioning all plans.-1.00------
15Structural EngineeringN/A; all structural engineering planning is being completed by homeowner/other. N/A - engineering already performed and provided by others-1.00------
16Energy ReviewThird-party energy audit, required by the City of Dallas for any remodels or additions with new fixtures and/or roof square footage. Actual cost spent via Expense Spreadsheet = $885 ($150 labor, $550 subs)550.001.00----3.75150.00
17Permitting - BuildingEstimated total cost of city fees to process the permit and perform inspections, using their online estimator. Actual cost will vary slightly. Includes approximately X hours of management time to prepare and process the permit.Present Knowledge: According to expense spreadsheet, current expense from beginning of project = $12,692.29 mats, $966.20 labor verified cost/pricing 2.14.2412,692.291.00----24.25970.00
18Permitting - ZoningApply for a Certificate of Appropriateness (required by the City of Dallas for historic districts). Cost of ROW permitting sheet received by UP on 1.19.24 = $5500 Including the current expense labeled "permitting - city fees (subs) due to being a part of ROW and zoning. = $1,892.08 subs Total = $7,392.08 verified cost/pricing 2.14.247,392.081.00----8.00320.00
19Form Board SurveyAdditional site survey to include locations of forms for poured footings; required by the City before calling for the foundation inspection for pour authorization.Cost for form board survey (required to verify placement of concrete forms during inspection), with ~$200 allowance for higher cost if a perimeter survey is required as well. Price entered is the price paid from Form Board Survey performed on 2/6/24435.001.00----1.0040.00
20Inspection Management Project management hours to manage inspections throughout the process. We will require the following inspections: - Rough electrical - Rough plumbing - Insulation/rough energy - Rough zoning - Rough framing - Final electrical - Final plumbing - Final energy - Final zoning/buildingProject management hours to obtain the permit and manage inspections. Could plan for a min of 2 hrs per inspection = 18 hrs of MGMT-1.00----18.00720.00
21Design Phase - Additional Layout and Finish SelectionIf design and/or planning is needed for “x and y scope”, we will quote a preliminary design phase. An allotment of 30 design hours will be set aside for any delegated design or finish selections during construction. -1.00------
22Port-A-Potty RentalPrice estimated based on a monthly rental of a portable toilet for the duration of this project. We will remove the unit towards the end of the project when we are waiting on finishes and/or performing punch list tasks sporadically.Monthly rental of portable toilet, estimating up to 12 months for the duration of the primary structure remodel.150.0012.00------
23Temporary FencePrice estimated based on monthly rental of fence and rough linear footage of space needing to be closed off. We may remove the fence towards the end of the project once the property has been properly secured or when a new fence is to be installed.Allowance for setting up a temporary security and privacy fence during construction; we will discuss this with the owners and assess feasibility given the limited site space.225.0012.00------
24T-Pole SetupCost of temporary power set up is include in the Electrical - Labor and Materials.Allowance for setting up and later breaking down a temporary electric pole for uninterrupted service during construction. This will allow us to get the existing lines out of the way of the new construction.-1.00------
25Site Preparation and ClearingCost to remove all existing concrete and non-utility site obstructions that would interfere with new foundation and concrete work as specified on the plans.Concrete Demo (from Palemon) = $14,00814,008.001.00------
26Construction AreaAll rough grading will be done in conjunction with the pier and beam construction. N/A - pricing is included in concrete foundation costs. -1.00------
27Concrete SlabsProcess to include: - Pouring new foundation to be a 4" thick slab with 12" x 24" interior and perimeter beams - Perimeter beam final elevations to be determined once elevations are set and will be a minimum of 12" x 24" - Additionally 12" x 6" void boxes between the drilled piers ***All foundation components to follow specifications laid out in the engineering plansFoundation Price (from Palemon): $30,38030,380.001.00------
28Perimeter Beam and PiersProcess to include: - Drill out 18 piers with a 12" diameter approx. 12' in depth or to be drilled 1' - 3' into grey limestone - Piers will be reinforced with 1 - 7" rebar and will not extend into the foundation beams ***All foundation components to follow specifications laid out in the engineering plansPiers Price and Concrete Pump (from Palemon) = $16,55016,550.001.00------
29Site and Surface DrainagePrice includes the trenching and installation of all roof drain and rain run off plumbing throughout the job site. 14 downspouts to be connected and discharged to the front of the residence. 2 - 4" pop-up emitters on rear of the residence.Pedro Quote: $25478 Incl. downspouts, catch basin's, pop up emitters, and things with the driveway.25,478.001.00------
30-1.00------
31
32Pre-Construction and Site Management Total
33
Worksheet
Cell Formulas
RangeFormula
Q14:Q30Q14=(K14*'https://ripleyrenovations.sharepoint.com/sites/HomeBase/Shared Documents/Templates and Forms/Estimate Templates/[Estimate.xlsx]Data'!$C$10)+(L14*'https://ripleyrenovations.sharepoint.com/sites/HomeBase/Shared Documents/Templates and Forms/Estimate Templates/[Estimate.xlsx]Data'!$D$10)+(M14*'https://ripleyrenovations.sharepoint.com/sites/HomeBase/Shared Documents/Templates and Forms/Estimate Templates/[Estimate.xlsx]Data'!$C$11)+(N14*'https://ripleyrenovations.sharepoint.com/sites/HomeBase/Shared Documents/Templates and Forms/Estimate Templates/[Estimate.xlsx]Data'!$D$11)+(O14*'https://ripleyrenovations.sharepoint.com/sites/HomeBase/Shared Documents/Templates and Forms/Estimate Templates/[Estimate.xlsx]Data'!$D$12)
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Hello mirobers. Welcome to the forum. The code below simply looks at the first 9 rows and if Cell D1...D9 is empty (=""), then it sets the row height to 24. I hope this helps you get started.

VBA Code:
Sub D_row_height24()
i = 1
    While i < 10
        If Cells(i, 4).Value = "" Then
           Rows(i).RowHeight = 24
        End If
    i = i + 1
    Wend
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,941
Messages
6,175,537
Members
452,652
Latest member
eduedu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top