Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hello I want to create a command button that will change the font color of the active cell to a specific color but that is only allowed for a range of cells not the whole worksheet. Thanks for any help. -- CoronaSTX ------------------------------------------------------------------------ CoronaSTX's Profile: http://www.excelforum.com/member.php...o&userid=27958 View this thread: http://www.excelforum.com/showthread...hreadid=474581 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi CoronaSTX,
Assuming the button to be a Control Toolbox command button, try: '============= Private Sub CommandButton1_Click() Dim rng As Range Set rng = Range("A1:H20") '<<====== Change If Not Intersect(rng, ActiveCell) Is Nothing Then With ActiveCell.Font If .ColorIndex = 3 Then .ColorIndex = xlAutomatic Else .ColorIndex = 3 End If End With End If End Sub '<<============= Change the address of the rng variable to accord with that of your range of interest. Change the ColorIndex value from 3 (red) to suit your requirements. --- Regards, Norman "CoronaSTX" wrote in message ... Hello I want to create a command button that will change the font color of the active cell to a specific color but that is only allowed for a range of cells not the whole worksheet. Thanks for any help. -- CoronaSTX ------------------------------------------------------------------------ CoronaSTX's Profile: http://www.excelforum.com/member.php...o&userid=27958 View this thread: http://www.excelforum.com/showthread...hreadid=474581 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi Norman Jones, Thanks so much your reply, it worked perfectly. :) I have another question. How would I create a command button to insert a row only in a certain range of cells or lets say only between A19 and A80 a user could insert a row but not before or A19 or after A80. Again thanks for any help. -- CoronaSTX ------------------------------------------------------------------------ CoronaSTX's Profile: http://www.excelforum.com/member.php...o&userid=27958 View this thread: http://www.excelforum.com/showthread...hreadid=474581 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() How would I create a command button to insert a row only in a certain range of cells or lets say only between A19 and A80 a user could insert a row but not before or A19 or after A80. Again thanks for any help. -- CoronaSTX ------------------------------------------------------------------------ CoronaSTX's Profile: http://www.excelforum.com/member.php...o&userid=27958 View this thread: http://www.excelforum.com/showthread...hreadid=474581 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Something like:
With ActiveCell If .Row = 18 And .Row <=80 Then .EntireRow.Insert End With -- Vasant "CoronaSTX" wrote in message ... How would I create a command button to insert a row only in a certain range of cells or lets say only between A19 and A80 a user could insert a row but not before or A19 or after A80. Again thanks for any help. -- CoronaSTX ------------------------------------------------------------------------ CoronaSTX's Profile: http://www.excelforum.com/member.php...o&userid=27958 View this thread: http://www.excelforum.com/showthread...hreadid=474581 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
command button add another command | Excel Discussion (Misc queries) | |||
Command button | Excel Discussion (Misc queries) | |||
Command Button | Excel Programming | |||
Command Button vs Control Button | Excel Programming | |||
Command Button vs Form Button | Excel Programming |