Refresh Page When Date Changes

  • I want to create a Macro in such a way that whenever a date is changed or multiple date entered in anywhere in Column C3 onwards and then enter key is pressed the page should refresh automatically. Pressing enter anywhere else in the sheet nothing should happen.


    This is because I have created a Macro and every time I change the Date I have to Press Data-Refresh

  • Hi,


    You can add an Event macro in the Sheet module, so that every change will trigger your macro:


    Code
    Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.count > 1 Then Exit Sub
    If Target.Column <> 3 Then Exit Sub
    Application.Run ("YourRefreshMacro")
    End Sub

    Hope this will help :)

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Smiley" icon, below, in the bottom right corner :)

  • Carim

    Changed the title of the thread from “Refresh Page When Dae Changes” to “Refresh Page When Date Changes”.
  • Thanks Works Very Well in my Sample Work Sheet.


    But when I am trying to implement it in my main worksheet nothing happens.

    This may be because I already have a VBA code in my main work sheet, and both Private Sub is not working.

    This Code I have written so anything I type is converted to Capital Letters.


    Here is the Code ( I do not know how to highlight the VBA code so writing it normally )


    Edited once, last by Carim: Added Code Tags ().

  • Hello,


    May be it would easier to merge all your macros into a single one


    Code
    Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Count > 1 Then Exit Sub
    If Target.Column <> 3 Then Exit Sub
        If Not IsEmpty(Target.Offset(0, 1)) Then
          Target.Offset(0, 1).Value = UCase(Target.Offset(0, 1).Value)
        End If
    End Sub

    Hope this will help

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Smiley" icon, below, in the bottom right corner :)

  • You are welcome

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Smiley" icon, below, in the bottom right corner :)

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!