VBA Datepicker Error when selection column and rows.

shaunee06

New Member
Joined
Apr 3, 2020
Messages
3
Office Version
  1. 365
Good Morning! Working from home has found me building a master excel sheet for data collection. Im very new to a fair amount of the less than obvious features but heres what I have going on.

First:
I have a datapicker VBA running and its doing well OTHER THAN when I select the columns or rows I get an error " Run-time error '440': Invalid property value". When I click Debug, I see .LinkedCell = Target.Address highlighted in my code:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

With Sheet1.DTPicker1
.Height = 20
.Width = 20
If Not Intersect(Target, Range("C:C")) Is Nothing Then
.Visible = True
.Top = Target.Top
.Left = Target.Offset(0, 1).Left
.LinkedCell = Target.Address
Else
.Visible = False
End If
End With

With Sheet1.DTPicker2
.Height = 20
.Width = 20
If Not Intersect(Target, Range("I:N")) Is Nothing Then
.Visible = True
.Top = Target.Top
.Left = Target.Offset(0, 1).Left
.LinkedCell = Target.Address
Else
.Visible = False
End If

End With

Any help with this would be AMAZING! ill have a second post up asking about prioritizing here shortly...
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
scrolling over the ever pops up "Target.Address="$k:$K".

This only happens when i click on the Column letters. I get a second error when I click on the row numbers

.Left = Target.offset(0, 1).left

when i scroll over that it shows
target.offset(o,1).left = <application-defined or object-defined error>
 
Upvote 0

Forum statistics

Threads
1,214,907
Messages
6,122,185
Members
449,071
Latest member
cdnMech

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