View code vanished on me? Help!

bowlesj

New Member
Joined
Aug 28, 2011
Messages
26
Hi, strange problem IMHO :) I am wondering if someone can figure this one out?

I clicked the developer tab then the clicked the view code button and placed the code below in. It worked as it always does and it is still working. The problem is I changed my mind and I want to remove it and when I go back and click the developer tab then the click the view code button it is not there. I tried a bunch of things to figure it out with no luck. This might help someone know what is going on. I have another sheet which is xls and it has the same sub routine. In that sheet I can go back the same way and find the code. This sheet where I can not find the code asked me some questions after I put the routine in and I decided to save it as xlsx. So I went back to find the xls version and it is missing from the folder. I guess I should check trash since it has all the other updates (just did - the xls is not in trash).

A related question. I am very good with MS-Access and its VBA but not very good with Excel and its VBA. Where do I learn more about the storing of Excel VBA? It seems a lot more complex than MS-Access.

Thanks,
John

VBA Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'UpdatebyExtendoffice6/1/2016
    Application.ScreenUpdating = False
    With Target
        .Worksheet.Cells.Interior.ColorIndex = 0
        .EntireRow.Interior.Color = vbYellow
        '.EntireColumn.Interior.Color = vbYellow
    End With
    Application.ScreenUpdating = True
End Sub
 
Last edited:

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Thanks MARK858. I guess I did not read the prompts correctly. In the past I have done it correctly. John
 
Upvote 0

Forum statistics

Threads
1,215,054
Messages
6,122,893
Members
449,097
Latest member
dbomb1414

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