+ Reply to Thread
Results 1 to 2 of 2

Auto-adjust all row heights with +15 padding

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    05-21-2014
    Location
    United States
    MS-Off Ver
    Office 365 on Windows 10
    Posts
    122

    Question Auto-adjust all row heights with +15 padding

    I work with the same Excel file each day and I am constantly making updates to data in each row, adding and removing lines in each cell.

    I prefer to have 15 padding in each row. For example, where there is one line of text, the row height is 30. Where there are two lines of text, the row height is 45, etc.

    Is there a way to auto adjust row height with padding such as this added?

  2. #2
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,527

    Re: Auto-adjust all row heights with +15 padding

    Paste this code to sheet module
    Private Sub Worksheet_Change(ByVal Target As Range)
        Dim dblStH      As Double
        Dim dblRwH      As Double
    
        If Target.CountLarge > 1 Then
            MsgBox "Change only one cell.", vbExclamation
        ElseIf Target.MergeCells Then
            MsgBox "A cell cannot be merged.", vbExclamation
        End If
    
    
        dblStH = Me.StandardHeight
        Target.EntireRow.AutoFit
        dblRwH = Target.Height
        Target.RowHeight = dblRwH + dblStH
    End Sub
    Artik

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Auto fit Row Heights In Merged Cells
    By colin7 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-30-2019, 12:23 PM
  2. Row heights do not adjust correctly after sorting
    By ra3940 in forum Excel General
    Replies: 1
    Last Post: 02-23-2017, 02:32 PM
  3. [SOLVED] How to adjust row height of row so tall the point to grab to adjust auto falls below
    By juntjoo in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 06-22-2016, 02:07 PM
  4. [SOLVED] Adjust Row Heights when entering data
    By guitarsweety in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-29-2014, 08:22 AM
  5. [SOLVED] quickly adjust row heights
    By jimboryan in forum Excel General
    Replies: 6
    Last Post: 05-23-2014, 08:14 PM
  6. [SOLVED] Auto Adjust Stacked Column Need to Adjust Legend
    By tbren in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 03-29-2013, 01:56 PM
  7. Replies: 1
    Last Post: 06-23-2006, 10:06 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1