Hi!
This is my first post in this community.
I have little experience with programming and even less with VBA and I'm having a little trouble with some codes:
In those first, I actually solved the problem by deleting each cell at a time,
but I wanted to do a cleaner code.
I'm getting a critic "Select Method of Range class failed"
[VBA]Sheets("Relatorio").Range("A210").Select
Selection.ClearContents
Sheets("Relatorio").Range("A1321").Select
Selection.ClearContents[/VBA]
[VBA]Sheets("Planilha").Range("B4:B7").Select.ClearContents
Sheets("Planilha").Range("B11:B15").Select.ClearContents
Sheets("Planilha").Range("B17:B18").Select.ClearContents[/VBA]
Now on this one, I'm trying to hide the range depending on what is on a cell, which is formated with a data validation, as a list.
[VBA]Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Not Intersect(Target, Range("B2")) Is Nothing Then
Call changeFESP
End If
Application.EnableEvents = True
End Sub
Sub changeFESP()
Select Case B2
Case FESP
For Each cell In Range("A13:C15")
cell.EntireRow.Hidden = True
Next cell
Case Estatutário
For Each cell In Range("A13:C15")
cell.EntireRow.Hidden = False
Next cell
End Select
End Sub[/VBA]
Any kind of light is here welcome.
Thanks in advance!