LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Loop macro in selected range

Hi,

I am new to VBA. I dug up a macro on the web somewhere. It does what
is has to do, but only for the active cell. When I select multiple
cells the macro only works on one cell. I would like it to loop, and
do all the cells.

I tried recording a macro for a selection, but only got this:

Range("A1:A4,C7,D9,A11:G11").Select
Range("A11").Activate
Application.Run "Macro1"

and that several times


This is what I would like:

I've selected A1:A4,C7,D9,A11:H11

The excisting macro is named Macro1 and gives the cell a red color.

If I run the macro now only A11 turns red.

I would like a macro that repeats Macro1 for the active selection.

Can anybody tell me how this is done?

Thanx,

Sjaak
 
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
Loop thru range and determine if filename exists in selected folder burl_h Excel Programming 3 January 22nd 09 10:46 AM
trying to delete selected range with macro DKY[_74_] Excel Programming 7 August 27th 05 01:58 PM
Macro run if and cell in range is selected in VBA Celtic_Avenger[_38_] Excel Programming 1 September 18th 04 04:51 PM
Macro run if and cell in range is selected in VBA Celtic_Avenger[_37_] Excel Programming 1 September 18th 04 03:28 PM
TO TOM OR KEN: macro to calculate selected range mary Excel Programming 3 January 19th 04 05:45 PM


All times are GMT +1. The time now is 01:02 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"