Type Mismatch

robfo0

Active Member
Joined
Feb 19, 2002
Messages
281
Hi again,

I have the following code:
Private Sub Worksheet_Change(ByVal Target As Excel.Range)

If Target.Column = 1 Then
If Target = "x" Or Target = "X" Then
Target.Offset(0, 7) = Date
Target.Offset(0, :cool: = Application.UserName
Else
Target.Offset(0, 7) = ""
Target.Offset(0, :cool: = ""
End If
End If

End Sub

Which populates the Date and username when a user puts an x in column 1.

This works fine, but i also have a macro that cuts and pastes rows and clears the x. When i run the macro, i get a type mismatch error. Im sure its because the macro is clearing the x. How do i get around this? can i maybe disable the worksheeet_change when i run my other macro?

Thanks

Note, those are not really :cool: faces, its supposed to be 8 and ) , heh
This message was edited by robfo0 on 2002-03-10 19:05
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
In the other routine put

Application.enableevents = False

before it starts THEN @ the end of the routine
Put in
Application.enableevents=true


This will disable the events incase your routine
IS ?? within the range.

Ivan
 
Upvote 0

Forum statistics

Threads
1,213,482
Messages
6,113,916
Members
448,533
Latest member
thietbibeboiwasaco

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top