Private Sub WorkSheet_Change(ByVal Target As Range)
Dim i As Integer
Dim ws As Worksheet
Set ws = ActiveSheet
If Not Intersect(Target, Range("A1")) Is Nothing Then
For i = 1 To ActiveWorkbook.SlicerCaches("Slicer_Test").SlicerItems.Count
If ActiveWorkbook.SlicerCaches("Slicer_Test").SlicerItems(i).Value = ActiveSheet.Range("A1") Then
ActiveWorkbook.SlicerCaches("Slicer_Test").SlicerItems(i).Selected = True
Else
ActiveWorkbook.SlicerCaches("Slicer_Test").SlicerItems(i).Selected = False
End If
Next
End If
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
Dim myCell As Range
Application.EnableEvents = False
If Not Intersect(Target, Range("AA9:AA33")) Is Nothing Then
For Each myCell In Intersect(Target, Range("AA9:AA33"))
If IsEmpty(Range("AA" & myCell.Row)) Then Range("AA" & myCell.Row).Formula = "=IF($G" & myCell.Row & "=""Yes"",$Z" & myCell.Row & "/12,"""")"
Next myCell
End If
If Not Intersect(Target, Range("AB9:AB33")) Is Nothing Then
For Each myCell In Intersect(Target, Range("AB9:AB633"))
If IsEmpty(Range("AB" & myCell.Row)) Then Range("AB" & myCell.Row).Formula = "=IF($G" & myCell.Row & "=""Yes"",$Z" & myCell.Row & "/12,"""")"
Next myCell
End If
If Not Intersect(Target, Range("AC9:AC33")) Is Nothing Then
For Each myCell In Intersect(Target, Range("AC9:AC33"))
If IsEmpty(Range("AC" & myCell.Row)) Then Range("AC" & myCell.Row).Formula = "=IF($G" & myCell.Row & "=""Yes"",$Z" & myCell.Row & "/12,"""")"
Next myCell
End If
If Not Intersect(Target, Range("AO9:AO33")) Is Nothing Then
For Each myCell In Intersect(Target, Range("AO9:AO33"))
If IsEmpty(Range("AO" & myCell.Row)) Then Range("AO" & myCell.Row).Formula = "=IF($G" & myCell.Row & "=""Yes"",$AN" & myCell.Row & "/12,"""")"
Next myCell
End If
If Not Intersect(Target, Range("AP9:AP33")) Is Nothing Then
For Each myCell In Intersect(Target, Range("AP9:AP33"))
If IsEmpty(Range("AP" & myCell.Row)) Then Range("AP" & myCell.Row).Formula = "=IF($G" & myCell.Row & "=""Yes"",$AN" & myCell.Row & "/12,"""")"
Next myCell
End If
Application.DisplayAlerts = False
Sheets("temp_cmTracker_1").dElete
Application.DisplayAlerts = True
uf_Message_downLoad.StartUpPosition = 2
uf_Message_downLoad.Show
Sub Macro1()
With Sheets("Sheet2")
.Range("B4").Name = "Marea"
For c = 0 To 34
If Month(.Range("c3").Offset(0, c)) = 1 Then
Range("MArea") = Range("MArea") + Range("C4").Offset(0, c)
End If
Next c
End With
'
With Range("MArea").Interior
.Pattern = xlSolid
.Color = 255
.TintAndShade = 0
.PatternTintAndShade = 0
End With
End Sub
Sub CreateFolderStructure()
Dim objRow As Range, objCell As Range, strFolders As String
For Each objRow In ActiveSheet.UsedRange.Rows
strFolders = "C:\Users\Anthony.Martin\Documents\0-Test"
For Each objCell In objRow.Cells
strFolders = strFolders & "\" & objCell
Next
Shell ("cmd /c md " & Chr(34) & strFolders & Chr(34))
Next
End Sub
Dim TargetRow As Range
ActiveCell.EntireRow.Range("B7:N200") = TargetRow
If Not TargetRow Is Nothing Then
'Do something
Else
Exit sub
End If
End Sub
A | B | C | |
1 | John | A. | Smith |
A | B | C | |
1 | John A. Smith |
For i = 3 To lastrow3 Step 1
If ActiveSheet.Range("F" & i).Value = "" Then
ActiveSheet.Range("F" & i).Formula = "=RC[-2]/R[" & lastrow3 + 1 - i & "]C[-2]"
End If
Next i
ActiveSheet.Range("F3").Formula ="RC[-2]/R[" .............. "]C[-2]"
ActiveSheet.Range("F3").Copy Destination:=ActiveSheet.Range("F4:F" & lastrow3)