HELP PLEASE!!! How to delete applied format after navagating to different row

photonicman

New Member
Joined
Nov 7, 2007
Messages
20
I want to have the macro delete the color applied once a new "Row" is selected!

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

Dim RR As Range
Set RR = Target

Cells(RR.Row, 2).Interior.ColorIndex = 36
Cells(RR.Row, 3).Interior.ColorIndex = 36
Cells(RR.Row, 4).Interior.ColorIndex = 36

End Sub
 
Last edited:
Only want the minutes

If you want the minutes as a number you can use

=MINUTE(A1)

If you want the minutes as time you can use

=MINUTE(A1)/1440

and format the cell as time, ex.: hh:mm

If you want to use the function Text() then besides the minutes you have to specify either the hours or seconds. Ex:

=RIGHT(TEXT(A1,"h:mm"),2)

The problem is that the "m" in the format string can be either month or minute and in case of doubt excel chooses month. That's why you were getting the result 1. If you specify next to the minutes either the hours or the seconds there's no longer doubt that you really want minutes.
 
Upvote 0

Forum statistics

Threads
1,226,772
Messages
6,192,928
Members
453,767
Latest member
922aloose

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top