Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default vba repeat in the next cell down

I am trying to create a refresh macro that turn a number of cells back to
green.

I no i can do it at a an individual cell (i have pasted the code i have
used) level is there an easier less time consuming way as i have quite a few
cells i need to do this for.

Range("B2").Select
ActiveCell.FormulaR1C1 = "Green"
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default vba repeat in the next cell down

Range("B2,c3:c99,d1,e1,f3:f8").value = "Green"

Gets a lot of cells at once.

Jelinek wrote:

I am trying to create a refresh macro that turn a number of cells back to
green.

I no i can do it at a an individual cell (i have pasted the code i have
used) level is there an easier less time consuming way as i have quite a few
cells i need to do this for.

Range("B2").Select
ActiveCell.FormulaR1C1 = "Green"


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 325
Default vba repeat in the next cell down

Jelinek,

Try

Sub ColourSelection()
Dim TargetCell As Object
For Each TargetCell In Selection
Selection.Interior.ColorIndex = 38
Next
End Sub

You can select multiple cells/ranges on a worksheet by holding down the
Control key whilst you click and select them.

Then run the macro - all the selected cells will (in this case) turn light
pink.
Try changing the number to change the colour or use
Selection.Interior.ColorIndex = 38
to remove colour completely.

Here's a list of colours and their corresponding values.
Those with a D after them indicate duplicates - i.e. colours that can be
generated by more than one number.

Black 1
White 2
Red 3
Bright Green 4
Blue 5
Yellow 6
Pink 7
Turquoise 8
Dark Red 9
Green 10
Dark Blue 11
Dark Yellow 12
Violet 13
Teal 14
Gray-25% 15
Gray 50% 16
Periwinkle 17
Plum (D54) 18
Ivory 19
Light Turquoise (D34) 20
Dark Purple 21
Coral 22
Ocean Blue 23
Ice Blue 24
Dark Blue (D11) 25
Pink (D7) 26
Yellow (D6) 27
Turquoise (D8) 28
Violet (D13) 29
Dark Red (D9) 30
Teal (D14) 31
Blue (D5) 32
Sky Blue 33
Light Turquoise 34
Light Green 35
Light Yellow 36
Pale Blue 37
Rose 38
Tan 40
Light Blue 41
Aqua 42
Lime 43
Gold 44
Light Orange 45
Orange 46
Blue-Gray 47
Gray-40% 48
Dark Teal 49
Lavender 49
Sea Green 50
Dark Green 51
Olive Green 52
Brown 53
Plum 54
Indigo 55
Gray 80% 56

Hope this helps

Regards

Pete



"Jelinek" wrote:

I am trying to create a refresh macro that turn a number of cells back to
green.

I no i can do it at a an individual cell (i have pasted the code i have
used) level is there an easier less time consuming way as i have quite a few
cells i need to do this for.

Range("B2").Select
ActiveCell.FormulaR1C1 = "Green"

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
Repeat value from cell above Cefoxtrot New Users to Excel 4 October 11th 08 03:02 PM
data in 1 column/cell to automatically repeat in another cell/col Warthog New Users to Excel 1 July 3rd 08 01:42 PM
Copy data in one cell to blank cell immediately below, repeat Jeff Excel Worksheet Functions 1 May 19th 06 07:12 PM
I need to automatically repeat cell tyunika Excel Worksheet Functions 1 March 6th 06 10:07 PM
Title Cut Off if Rows to Repeat & Columns to Repeat are Both Selec unibaby Excel Discussion (Misc queries) 2 August 24th 05 04:29 PM


All times are GMT +1. The time now is 10:41 AM.

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"