Lacan
Board Regular
- Joined
- Oct 5, 2016
- Messages
- 237
- Office Version
- 365
- Platform
- Windows
Hi Guys,
Hope all of you are fine!
Would like your help in this question:
Have this 3 different codes below that work very fine but would like to use them in one specific sheet and not all entire workbook?
What kind of changes have to add in each one code?
-----------------------------------------
Hope all of you are fine!
Would like your help in this question:
Have this 3 different codes below that work very fine but would like to use them in one specific sheet and not all entire workbook?
What kind of changes have to add in each one code?
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("C20")) Is Nothing Then
If Target.Cells.Count > 1 Or IsEmpty(Target) Then Exit Sub
Cells(20, 2).Value = Format(Date, "dd-mmm")
End If
End Sub
-----------------------------------------
VBA Code:
Sub Linha()
'
' Linha Macro
'
'
Rows("24:24").Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Range("C24:S24").Select
With Selection
.Font.Bold = True
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Selection.Merge
With Selection
.Font.Bold = True
.HorizontalAlignment = xlLeft
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
With Selection.Font
.Color = -65536
.TintAndShade = 0
End With
Range("C24:S24").Select
End Sub
Sub Novo()
'
' Novo Macro
'
'
Rows("20:25").Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Range("B20").Select
Selection.NumberFormat = "dd-mmm"
Range("B24").Select
ActiveCell.FormulaR1C1 = "OBJECTIVO"
Range("C20:S20").Select
With Selection
.Font.Bold = True
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Selection.Merge
With Selection
.Font.Bold = True
.HorizontalAlignment = xlLeft
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
Selection.Borders(xlEdgeLeft).LineStyle = xlNone
Selection.Borders(xlEdgeTop).LineStyle = xlNone
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
Selection.Borders(xlEdgeRight).LineStyle = xlNone
Selection.Borders(xlInsideVertical).LineStyle = xlNone
Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
Selection.AutoFill Destination:=Range("C20:S24"), Type:=xlFillDefault
Range("C20:S24").Select
Range("B20:B24").Select
With Selection
.HorizontalAlignment = xlLeft
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Range("B20:S24").Select
With Selection.Font
.Name = "Calibri"
.Size = 12
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ThemeColor = xlThemeColorLight1
.TintAndShade = 0
.ThemeFont = xlThemeFontMinor
End With
With Selection.Font
.Color = -65536
.TintAndShade = 0
End With
Range("C20:S24").Select
End Sub
Customer File.xlsb | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | |||
1 | ||||||||||||||||||||||
2 | Bio | Un. Tipo | ||||||||||||||||||||
3 | RANK | |||||||||||||||||||||
4 | Coordenador | |||||||||||||||||||||
5 | Limpezas | |||||||||||||||||||||
6 | Horário de Visita | |||||||||||||||||||||
7 | Observações | |||||||||||||||||||||
8 | ||||||||||||||||||||||
9 | N.º | |||||||||||||||||||||
10 | ||||||||||||||||||||||
11 | ||||||||||||||||||||||
12 | ||||||||||||||||||||||
13 | ||||||||||||||||||||||
14 | ||||||||||||||||||||||
15 | ||||||||||||||||||||||
16 | ||||||||||||||||||||||
17 | ||||||||||||||||||||||
18 | ||||||||||||||||||||||
19 | ANOTE O QUE DE RELEVANTE ACONTECEU NA PRESENTE ENTREVISTA E ESCREVA A FORMA COMO VAI COMEÇAR A PRÓXIMA ENTREVISTA DE VENDAS. | |||||||||||||||||||||
20 | ||||||||||||||||||||||
21 | ||||||||||||||||||||||
22 | ||||||||||||||||||||||
23 | ||||||||||||||||||||||
24 | OBJECTIVO | |||||||||||||||||||||
25 | ||||||||||||||||||||||
26 | ||||||||||||||||||||||
ORGANIZATION |
Cells with Data Validation | ||
---|---|---|
Cell | Allow | Criteria |
B2 | List | =#REF!$A$3# |
C2:G2 | Any value |