rickyckc
Active Member
- Joined
- Apr 1, 2004
- Messages
- 327
Hi All,
I have a script that is supposed to...
1) Change formula to values
2) Clear validation
3) Delete all 3 conditional format and
4) Delete column G
In my sheet, Row A3:Q3 are merged. Row A8:Q8 are also merged.
My problem is, if I do it manually, I am able to delete column G but if I run my script, column A to Q are deleted. What's wrong with the my script below ?
Sub FormA()
'
Cells.Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
With Selection.Validation
.Delete
.Add Type:=xlValidateInputOnly, AlertStyle:=xlValidAlertStop, Operator _
:=xlBetween
.IgnoreBlank = True
.InCellDropdown = True
.ShowInput = True
.ShowError = True
End With
Selection.FormatConditions.Delete
Columns("G:G").Select
Range("G2").Activate
Selection.Delete Shift:=xlToLeft
Range("A2").Select
End Sub
I have a script that is supposed to...
1) Change formula to values
2) Clear validation
3) Delete all 3 conditional format and
4) Delete column G
In my sheet, Row A3:Q3 are merged. Row A8:Q8 are also merged.
My problem is, if I do it manually, I am able to delete column G but if I run my script, column A to Q are deleted. What's wrong with the my script below ?
Sub FormA()
'
Cells.Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
With Selection.Validation
.Delete
.Add Type:=xlValidateInputOnly, AlertStyle:=xlValidAlertStop, Operator _
:=xlBetween
.IgnoreBlank = True
.InCellDropdown = True
.ShowInput = True
.ShowError = True
End With
Selection.FormatConditions.Delete
Columns("G:G").Select
Range("G2").Activate
Selection.Delete Shift:=xlToLeft
Range("A2").Select
End Sub