This worked!
It worked on your workbook here.
What if you go
Developer
Macros
Highlight (Select) "Maybe" in the little window
Run
Thanks so much!
This worked!
It worked on your workbook here.
What if you go
Developer
Macros
Highlight (Select) "Maybe" in the little window
Run
Thanks so much!
Yes, each cell below Select is the one I want the ability to clear. I pasted it into Module 1 and saved it. I went to the Developer site on the ribbon and clicked on Insert and chose a Forms Control button and it immediately prompted me to select the Macro, which is named Maybe. It still did not clear anything.
Below is a link to my Box Cloud file folder. You do not need a Box account to download.
I tried pasting it into each sheet (1-11) and for the first time I got a reaction, which was a run time error. I chose debug and this popped up showing line four highlighted in yellow.
Sub AAAAA()
Dim sh2 As Worksheet
Dim j As Long, i As Long
Set sh2 = Sheets("Cells To Be Cleared")
For j = 1 To sh2.Cells(1, sh2.Columns.Count).End(xlToLeft).Column
For i = 2 To sh2.Cells(Rows.Count, j).End(xlUp).Row
Sheets(sh2.Cells(1, j).Text).Range(sh2.Cells(i, j)).ClearContents
Next i
Next j
End Sub
jolivanes, where do I place it in my workbook? In a new sheet12, or in the first sheet that I would hide it in?
vcoolio, from my very, very basic understanding of Visual Basic, you macro looks like it would clear contents in any cell with color and unfortunately, I have some cells that are shaded that I do not want cleared.
jolivanes, Below is the string of cells in each sheet that I want the ability to clear. I am uncertain if it matters, but each tab is named by me based upon its contents.
Sheet2
D9
D25
D36
J25
O25
Sheet3
D9
D25
D36
J25
N25
Sheet4
D9
D24
D35
J24
J35
O24
O35
Sheet5
D10
D25
D36
J25
J36
O25
O36
Sheet6
D10
D26
D35
D51
D62
L51
L62
Q10
Q26
Q35
Q51
Q62
Sheet7
D11
D25
D35
D51
D62
J51
J62
P12
P25
P35
P51
P62
Sheet8
D10
D26
D35
D51
D60
L51
L60
Q11
Q26
Q36
Q51
Q60
Sheet9
D10
D42
I26
I42
O11
O42
Sheet10
D10
D42
I26
I42
O11
O42
Sheet11
D10
D42
I26
I42
N11
N42
JonathanVH, I am trying to ClearContent in any way possible, because all the ways I've tried thus far does not work including FormControls and ActiveX Controls
Hi JonathanVH, I am still having difficulty in creating this macro, but I found one that uses the cell color to ClearContents from multiple sheets, but the example I got was for a range of cells in a row. My application is not a range. Here is what i found. Do you have any suggestions? That color is a lime green that I looked up from this site - http://www.endprod.com/colors/216safe.htm
Sub Macro()
Dim ws As Worksheet, cell As Range
For Each ws In Sheets(Array("Sheet2", "Sheet3", "Sheet4", "Sheet5", "Sheet6", "Sheet7", "Sheet8", "Sheet9", "Sheet10", "Sheet11"))
If cell.Interior.Color = 65280 Then
cell.ClearContents
End If
Next cell
Next ws
End Sub
OK, perhaps it's what I am doing once after I click into the last cell on the last page. I stop the recording and I then go to "View". I select the Macros down arrow and select "View Macros". From there I select the one I created and saved. The button I created seems to go live, but I get that error as stated above. Am I missing a step, or a keystroke?
Sorry for keep pressing, but I think I am close to it.
Thanks,
I understand that the end result should be the same when using VBA or Record a Macro. It seems easier to simply record keystrokes than writing code, but all of my attempts at recording a macro bring me a "Compile error: Invalid outside procedure". When searching on what that means, the explanation seems more to be correcting VisualBasic versus Recording Keystrokes. There was one video I saw that mentioned once it's better to use the keyboard to move keystrokes versus the mouse. Do you think that could be the problem? If so, would using Ctrl + PgDn fix that?
Thanks,
I have a workbook with 11 tabs, plus one at the beginning marked as "Start Here". I want to create one button in that tab that will clear up to 9 individual cells in each of these tabs. The cells I want to clear do not necessarily reside in the same spot on each page. Is this possible and how is it done? I presume this can be done in VisualBasic, but would it be easier for a neophyte to create it using Macros?