Results 1 to 3 of 3
  1. #1
    4 Star Lounger
    Join Date
    May 2004
    Location
    Toronto, Ontario, Canada
    Posts
    425
    Thanks
    5
    Thanked 0 Times in 0 Posts

    contiguous range -text (Excel 2000)

    Hi all,

    I'm trying to add text to a the first cell of a non-contigous range, what I would like is to select a multi-range of cells and add text to the beginning of each selected range. This works great with multiple selections to change the cell color, but I would like to add text to first cell in each selected range......IS IT POSSIBLE?

    Thanks,
    Darryl.



    Private Sub CommandButton10_Click()
    Dim c As Range
    Application.ScreenUpdating = False
    For Each c In Selection.Cells
    c.Interior.ColorIndex = 5
    c.Font.ColorIndex = 2
    c.Font.Bold = True
    c.Font.Size = 16
    Next c
    ActiveCell.FormulaR1C1 = "ToT"
    Application.ScreenUpdating = True

    End Sub

  2. #2
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: contiguous range -text (Excel 2000)

    Does this do what you want?

    <code>
    Dim oCells As Range
    For Each oCells In Selection.Areas
    oCells.Cells(1, 1).Value = "XX"
    Next oCells
    </code>
    Legare Coleman

  3. #3
    4 Star Lounger
    Join Date
    May 2004
    Location
    Toronto, Ontario, Canada
    Posts
    425
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Re: contiguous range -text (Excel 2000)

    Thank you! <img src=/S/fanfare.gif border=0 alt=fanfare width=31 height=23>

Posting Permissions

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