Trying to subtract a 80mm from listbox value then fill it into a excel cell A10

Darren Smith

Well-known Member
Joined
Nov 23, 2020
Messages
631
Office Version
  1. 2019
Platform
  1. Windows
The error says Could not get list property.

VBA Code:
Private Sub Toolpod_Width_Change()

   If ListBox1.ListIndex <> -1 Then
   
      TextBox1 = ListBox1.List(ListBox1.ListIndex, 9)
     End If
     
Dim ws As Worksheet
Dim BodyLength As ValueChange
Dim i As Long, Range As Long

Set ws = ThisWorkbook.Worksheets("Job Card Master")


    For i = 0 To Me.ListBox1.ListCount - 1
    If Me.ListBox1.Selected(i) Then
    ws.Range("A10") = Me.ListBox1.List(i, 9) - Me.Toolpod_Width.Value + 80
   
   End If

   
   Next i
   
End Sub
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
How are you populating the listbox?

How many columns does it have?
 
Upvote 0
From a spreadsheet.
There is 10 columns i only need a figure from the 9th column
 
Upvote 0

Forum statistics

Threads
1,215,432
Messages
6,124,856
Members
449,194
Latest member
HellScout

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