Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Fenna Bakker   on Sep 06 In MS Office Category.

  
Question Answered By: Adelbert Fischer   on Sep 06

I was working with this issue and found tht if i Change

Target.FormulaHidden = True TO

Range(Target.MergeArea.Address).FormulaHidden = True ,

works fine  if i use backspace  to delete  the contents. but this vl
show error  msg if i use Delete key  to delete the cell  contents.

Here is the code,

Private Sub Changed(ByVal Target As Range, Optional what As String)

Dim rowOffset As Integer
If IsEmpty(Cells(Target.Row, Target.Column)) Then

If (what <> "") Then
Select Case what
Case "Add"
Target.Formula = "=A+B"
rowOffset = 22
Case "Sub"
Target.Formula = "=C-D"
rowOffset = 23
End Select
Else
If ((Target.Row - 1) Mod (Max + Max + 1) < AddAcc + 2) Then
Target.Formula = "=A+B"
Else
Target.Formula = "=C-D"
End If
rowOffset = 0
End If

Target.Font.Italic = True
Target.Font.Bold = False

Target.FormulaHidden = True 'this line shows  the error.

Target.Offset(-1, 0).Select

Else

'Selecting next cell down
Target.Offset(1, 0).Select

End If

End Sub

Share: 

 

This Question has 4 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on FormulaHidden property for a merged cell in VBA Or get search suggestion and latest updates.


Tagged: