Text boxes move when I loop through columns then remove filter

ndjustin20

Board Regular
Joined
May 25, 2011
Messages
69
Hello Everyone !!!!

I have a strange issue and it only came about when I switched to using office 2010. I have a worksheet with several macros built in using visual basic. When I click on a button the macro runs this code:

Code:
Sub findWithin60Days()
Dim i%
For i = 1 To 300
    Range("E" & i).Interior.Color = RGB(197, 190, 151)
    If IsDate(Range("E" & i).Value) Then
    If Range("E" & i).Value <> "" Then
    If Range("E" & i).Value - Date < 60 Then
        Range("E" & i).Interior.Color = RGB(112, 48, 160)
    End If
    End If
    End If
Next i
Call FindNeedToRenew
End Sub

Here is the code for FindNeedToRenew

Code:
Sub FindNeedToRenew()
ActiveSheet.Range("$A$1:$T$300").AutoFilter Field:=5, Criteria1:=RGB(112, 48, 160), Operator:=xlFilterCellColor
        ActiveSheet.Range("2:7").Rows.Hidden = False
 
 
End Sub


Then to remove all filters I run this code which is another button/macro:


Code:
Sub RemoveFilter()
If ActiveSheet.AutoFilterMode = True Then ActiveSheet.AutoFilterMode = False
End Sub


The code does exactly what I want it to do but for some reason now it takes all of my text boxes at the top and squishes them into the first column and row. It never did this before with earlier versions so I'm at a loss as to why it is happening now. I can email the form as I don't see a way to upload anywhere or maybe I'm missing that option somewhere? The text boxes at the top are thrown values depending on what is clicked on the worksheet and are currently set to not move or resize with cell expansion/contraction. Any help would be greatly appreciated as I'm just about bald LOL


Justin :-)
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.

Forum statistics

Threads
1,224,581
Messages
6,179,668
Members
452,936
Latest member
anamikabhargaw

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