How do I reference a table field from outside of the table

dpaton05

Well-known Member
Joined
Aug 14, 2018
Messages
2,352
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
I have a check box that I want to enter a value in a field in a table if it is clicked. This is the code I have so far but it won't work. What else do I need to do?

Code:
Select Case chkIncrease_Click()
    Case Is = True
        index(npss_quote[10%Increase],1)="1.1"

npss_quote is the table name and 10%Increase is the column name. The table only has one line at the moment.

Thanks,
Dave
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
I tried this but it just put values all the way down the page and I want them just in the table.

If chkIncrease = True Then
Sheets("NPSS_quote_sheet").Range("m:m") = "1.1"
 
Upvote 0
I got it working with this code
Code:
Private Sub chkIncrease_Click()
If chkIncrease = True Then
    ListObjects("NPSS_quote").ListColumns("10%Increase").DataBodyRange.Value = "1.1"
Else
    ListObjects("NPSS_quote").ListColumns("10%Increase").DataBodyRange.Value = "1"
End If


'ActiveSheet.ListObjects("NPSS_quote").ListColumns("10%Increase").DataBodyRange.Select
End Sub

Is there a better way to write it, say using a Select Case statement? How would you write it as a select case statement?
 
Upvote 0

Forum statistics

Threads
1,215,063
Messages
6,122,935
Members
449,094
Latest member
teemeren

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