Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 75
Default Range - select row

Hi Scott,
try:

SingleCell.EntireRow.Select

Frederick Chow
"scott_hanebutt" wrote in message
...
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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can change range to select active rows instead of :=Range("S10 ldiaz Excel Discussion (Misc queries) 7 August 29th 08 03:52 PM
When entering data into a range of cells, select the entire range. Q Excel Discussion (Misc queries) 0 September 26th 07 04:36 AM
Compare a selected Range with a Named range and select cells that do not exist PCLIVE Excel Programming 1 October 18th 05 07:09 PM
How do I select a range using VBA? Howard Excel Programming 4 July 14th 04 02:17 PM
Select Sheet then Select Range Gee[_2_] Excel Programming 3 May 27th 04 10:10 PM


All times are GMT +1. The time now is 04:11 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"