Forum Discussion

beikme's avatar
beikme
Brass Contributor
Jul 24, 2020

Automatically print when cells value change

Hi all

 

Is there any why to Automatically print when cells value change ?

  • Bennadeau's avatar
    Bennadeau
    Iron Contributor

    Hi beikme,

     

    The below Macro will should do what you want.

    Just change the 3rd line to what ever range you want to trigger the print job. "Set KeyCells = Range("A1:C10")"

     

    If you want to print the active sheet and not the entire workbook, change the 6th line to: Activesheet.PrintOut

     

    Private Sub Worksheet_Change(ByVal Target As Range)
    Dim KeyCells As Range

    Set KeyCells = Range("A1:C10")

    If Not Application.Intersect(KeyCells, Range(Target.Address)) _
    Is Nothing Then

    ActiveWorkbook.PrintOut

    End If
    End Sub

    • Juan Pablo Gallardo's avatar
      Juan Pablo Gallardo
      Brass Contributor
      If the active range changes by a formula, then there is no trigger, how can we fix that?
    • beikme's avatar
      beikme
      Brass Contributor

      perfect it works thank you for that 

       

      one more thing 

      How can i get it when its scan slp in cell  1 to go to sn cell 2 and after go back to slp cell one 

       

       

       

       

      Bennadeau 

Resources