TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Gowri A
NA
54
47k
how to add worksheet change event to excel from c#
Sep 9 2014 10:09 AM
How to add the following excel vba sheetchange event to c#
Private Sub Worksheet_Change(ByVal
Target As Range)
If Not Intersect(Target, Range("A1",
"A101")) Is Nothing Then
Dim CellAddress, address,
position, formula1 As String
CellAddress = Target.address
If Range(CellAddress).Value
<> "" Then
address = CellAddress
position = Mid(address, 4,
3)
Range("B" &
position).Select
Range("B" &
position).Clear
With
Selection.Validation
.Delete
.Add
Type:=xlValidateList,
AlertStyle:=xlValidAlertStop,
Operator:= _
xlBetween,
formula1:="=indirect(A" & position &
")"
.IgnoreBlank = True
.InCellDropdown =
True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
End If
End If
End Sub
Reply
Answers (
0
)
read words and formulas separately in c# .net 2013
System.NullReferenceException: Object reference not set to a