SOLVED

Controlling row heights of long text in a cell selection

%3CLINGO-SUB%20id%3D%22lingo-sub-2542193%22%20slang%3D%22en-US%22%3EControlling%20row%20heights%20of%20long%20text%20in%20a%20cell%20selection%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2542193%22%20slang%3D%22en-US%22%3E%3CP%3EGood%20morning%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ei%20wanted%20to%20increase%20the%20distance%20between%20lines%20of%20a%20long%20text%20that%20i%20inserted%20in%20a%20selection%20of%20cells%20grouped%20with%20%22merge%22%20and%20with%20%22wrap%20text%22.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAre%20there%20any%20VBA%20commands%20that%20do%20what%20I%20need%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you%20for%20your%20help%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWith%20Range(%22A9%3AI20%22)%3CBR%20%2F%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20.Merge%3CBR%20%2F%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20.WrapText%20%3D%20True%3CBR%20%2F%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20.VerticalAlignment%20%3D%20xlTop%3CBR%20%2F%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20.HorizontalAlignment%20%3D%20xlJustify%3CBR%20%2F%3EEnd%20With%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Captura%20de%20ecr%C3%A3%202021-07-13%20102018.jpg%22%20style%3D%22width%3A%20717px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F295427iB9AA27F792E75D92%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Captura%20de%20ecr%C3%A3%202021-07-13%20102018.jpg%22%20alt%3D%22Captura%20de%20ecr%C3%A3%202021-07-13%20102018.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2542193%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMacros%20and%20VBA%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2542218%22%20slang%3D%22en-US%22%3ERe%3A%20Controlling%20row%20heights%20of%20long%20text%20in%20a%20cell%20selection%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2542218%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1084899%22%20target%3D%22_blank%22%3E%40csoares%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EExcel%20doesn't%20provide%20control%20over%20line%20spacing%2C%20but%20you%20could%20use%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E.VerticalAlignment%20%3D%20%3CSTRONG%3ExlVAlignDistributed%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3Eor%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E.VerticalAlignment%20%3D%20%3CSTRONG%3ExlVAlignJustify%3C%2FSTRONG%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2542221%22%20slang%3D%22de-DE%22%3ERe%3A%20Controlling%20row%20heights%20of%20long%20text%20in%20a%20cell%20selection%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2542221%22%20slang%3D%22de-DE%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1084899%22%20target%3D%22_blank%22%3E%40csoares%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22VIiyi%22%3E%3CSPAN%20class%3D%22JLqJ4b%20ChMk0b%22%3E%3CSPAN%3EMaybe%20this%20will%20help%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-link-navigation%20lia-link-disabled%22%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fexcel%2Fis-it-possible-without-coding-to-automatically-modify-the-row%2Fm-p%2F2538675%23M106423%22%20target%3D%22_self%22%3EIs%20it%20possible%20(without%20coding)%20to%20automatically%20modify%20the%20row%20height%20in%20Excel%3F%3C%2FA%3E%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2556241%22%20slang%3D%22en-US%22%3ERe%3A%20Controlling%20row%20heights%20of%20long%20text%20in%20a%20cell%20selection%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2556241%22%20slang%3D%22en-US%22%3E72%20%2F%205000%3CBR%20%2F%3EResultados%20da%20tradu%C3%A7%C3%A3o%3CBR%20%2F%3Ethank%20you%20very%20much%20for%20the%20answers%20that%20helped%20me%20to%20solve%20the%20problem%20%3CLI-EMOJI%20id%3D%22lia_slightly-smiling-face%22%20title%3D%22%3Aslightly_smiling_face%3A%22%3E%3C%2FLI-EMOJI%3E%3C%2FLINGO-BODY%3E
Contributor

Good morning,

 

i wanted to increase the distance between lines of a long text that i inserted in a selection of cells grouped with "merge" and with "wrap text".

 

Are there any VBA commands that do what I need?

 

Thank you for your help

 

With Range("A9:I20")
          .Merge
          .WrapText = True
          .VerticalAlignment = xlTop
          .HorizontalAlignment = xlJustify
End With

 

Captura de ecrã 2021-07-13 102018.jpg

3 Replies
best response confirmed by csoares (Contributor)
Solution

@csoares 

Excel doesn't provide control over line spacing, but you could use

 

.VerticalAlignment = xlVAlignDistributed

 

or

 

.VerticalAlignment = xlVAlignJustify

72 / 5000
Resultados da tradução
thank you very much for the answers that helped me to solve the problem