+ Reply to Thread
Results 1 to 2 of 2

Box as rows and padding left

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    02-02-2008
    Location
    EU
    MS-Off Ver
    MS Excel 2007 Professional version
    Posts
    232

    Box as rows and padding left

    I have set testing excel box. How to
    1. move each line into row inside box and also set
    2. left padding and
    3. top padding.

    So, text inside box should be defined with space on the left and top relative to the box size.

    Is this technical possible? Need help.
    Attached Files Attached Files
    Last edited by toplisek; 07-28-2014 at 04:13 AM.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,303

    Re: Box as rows and padding left

    You could do it with VBA. Not sure if/how you would do it manually.

    Option Explicit
    
    Sub sCopyText()
    
    ' need to manually select cells before running this macro
    
    Dim cell As Range
    Dim sText As String
    Dim rTarget As Range
    Set rTarget = Range("B5")   ' change as required
    
    rTarget = ""
    sText = vbCrLf      ' start with a blank row (new line)
    
    For Each cell In Selection
        ' add some space, the cell value and a new line
        sText = sText & "   " & _
                cell.Value & _
                vbCrLf
    Next ' cell
    
    If Not sText = "" Then
        rTarget.Value = sText
    End If
    
    End Sub


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


+ 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. Replies: 3
    Last Post: 10-31-2012, 11:20 PM
  2. Padding the end of each row
    By smfernando in forum Excel General
    Replies: 0
    Last Post: 04-03-2008, 10:27 AM
  3. padding ?
    By vbastarter in forum Excel General
    Replies: 2
    Last Post: 03-07-2006, 08:11 AM
  4. [SOLVED] left padding + blank
    By Alex in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-05-2006, 06:25 PM
  5. left padding + blank
    By Alex in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-05-2006, 06:25 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