Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default Macro not working properly on change in cell value

Hi

Your test is case sensitive.

Change to:

If Target.Address = "$C$1" Then Refresh1

Regards,
Per


On 7 Feb., 08:13, Monk wrote:
Hi

I am attempting to run a macro when there is a change in cell value.

The code in the worksheet is as follows:

Private Sub Worksheet_Change(ByVal Target As Range)

*If Target.Address = "$c$1" Then Refresh1

End Sub

The code for the macro Refresh1 is

Sub Refresh1()
* Application.ScreenUpdating = False
* Application.Calculation = xlManual

* * ActiveSheet.ShowAllData

* * Range("A4:B2000").AdvancedFilter Action:=xlFilterInPlace, Unique:=True

* * Range("C4").Select
* * Application.Run "HideBlankRows"
* * Range("C1").Select
* * Application.Calculation = xlAutomatic
* * Application.ScreenUpdating = True
End Sub

Refresh1 works fine when running it via Tools/Macro/Macros however it
doesn't seem to work properly when there is a change in the cell value which
is supposed to run it automatically. *It appears that the ShowAllData and
HideBlankRows commands are not working.

Any assistance to detect my error would be appreciated.

Thanks

Monk


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro not working properly when run automatically ATChurch Excel Discussion (Misc queries) 9 April 1st 10 03:01 PM
Macro is not working properly Sherees Excel Discussion (Misc queries) 5 December 26th 09 09:18 AM
Macro not running properly on change in cell value Monk[_2_] Excel Programming 2 February 7th 09 08:39 AM
Macro Not Working Properly PA Excel Programming 4 February 8th 06 03:34 AM
Macro "1 tall/1 wide" not working properly gizmo Excel Worksheet Functions 2 January 10th 05 07:18 PM


All times are GMT +1. The time now is 11:48 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"