+ Reply to Thread
Results 1 to 5 of 5

Range - select row

  1. #1
    scott_hanebutt
    Guest

    Range - select row

    In my macro I have a range set to a single cell. The cell the range refers
    to changes throughout my program. I want to bold the entire row (or at least
    the first X columns in that row) that the range is on.

    Thanks,
    Scott Hanebutt

  2. #2
    Dave Peterson
    Guest

    Re: Range - select row

    dim myCell as range

    set mycell = worksheets("sheet99").range("x99") 'or something

    mycell.entirerow.font.bold = true

    or
    mycell.entirerow.resize(1, 10).font.bold = true

    Change 10 to whatever X meant.

    scott_hanebutt wrote:
    >
    > In my macro I have a range set to a single cell. The cell the range refers
    > to changes throughout my program. I want to bold the entire row (or at least
    > the first X columns in that row) that the range is on.
    >
    > Thanks,
    > Scott Hanebutt


    --

    Dave Peterson

  3. #3
    Frederick Chow
    Guest

    Re: Range - select row

    Hi Scott,
    try:

    SingleCell.EntireRow.Select

    Frederick Chow
    "scott_hanebutt" <[email protected]> wrote in message
    news:[email protected]...
    > In my macro I have a range set to a single cell. The cell the range
    > refers
    > to changes throughout my program. I want to bold the entire row (or at
    > least
    > the first X columns in that row) that the range is on.
    >
    > Thanks,
    > Scott Hanebutt




  4. #4
    Gary''s Student
    Guest

    RE: Range - select row

    This is just an example. Select a single cell and run this macro:

    Sub Macro3()
    Dim r As Range
    Dim s As String
    Set r = Selection
    s = r.Row
    Rows(s).Select
    With Selection.Interior
    .ColorIndex = 6
    .Pattern = xlSolid
    End With
    End Sub

    Of course, you would set r to whatever your range is, not Selection.
    --
    Gary's Student


    "scott_hanebutt" wrote:

    > In my macro I have a range set to a single cell. The cell the range refers
    > to changes throughout my program. I want to bold the entire row (or at least
    > the first X columns in that row) that the range is on.
    >
    > Thanks,
    > Scott Hanebutt


  5. #5
    scott_hanebutt
    Guest

    RE: Range - select row

    Thanks to everyone who replied. I decided to use Dave's suggestion and it
    worked perfectly.

    Thanks,
    Scott Hanebutt

    "scott_hanebutt" wrote:

    > In my macro I have a range set to a single cell. The cell the range refers
    > to changes throughout my program. I want to bold the entire row (or at least
    > the first X columns in that row) that the range is on.
    >
    > Thanks,
    > Scott Hanebutt


+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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