Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Macro / vb query

Hi,

This code will highlight (yellow background) columns 1 to 7 (A:G) in the row
where activecell is.

With ActiveCell.End(xlToLeft).Resize(1, 7)
.Interior.ColorIndex = 6
.Interior.Pattern = xlSolid
End With

if the left column of your table is not column A, you can add an offset. Eg,
this will highlight columns C:I

With ActiveCell.End(xlToLeft).Resize(1, 7).Offset(0, 2)
.Interior.ColorIndex = 6
.Interior.Pattern = xlSolid
End With

With this code it does not matter in which column you find the word you are
searching for.

regards
Lazzzx


"Dan Thompson" <Dan skrev i meddelelsen
...
I am trying to set up a macro that will find a row based on a specific
word,
then underline that row in the table.

I've tried recording it, and the find bit is fine, but I don't know how to
change the vb code to allow it to highlight columns 1 through 7 on the row
that has been found. At the moment, the code points to specific cells:

Range("A7:E7").Select

Any ideas please?

Thanks, Dan.


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
Macro Query rmsmith Excel Discussion (Misc queries) 1 December 15th 09 06:32 PM
Macro Query carla 7 Excel Discussion (Misc queries) 5 July 31st 08 04:07 PM
Web query: Want to pause macro while Web query completes refreshin Ellis Excel Programming 4 August 6th 07 04:04 AM
another macro query - deleting a worksheet within a query DavidHawes Excel Discussion (Misc queries) 2 February 26th 07 10:05 AM
NEW WEB QUERY MACRO A.J Setting up and Configuration of Excel 0 July 24th 05 04:31 AM


All times are GMT +1. The time now is 07:08 PM.

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

About Us

"It's about Microsoft Excel"