referring to the last row of a table

dpaton05

Well-known Member
Joined
Aug 14, 2018
Messages
2,375
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
I have a table with 32 columns to determine costings. Originally, it was going to have just one row and using that, my table was performing calculations etc correctly. There is a checkbox that allows a 10% increase to be put on the price. With only 1 row, I just set it so that if you clicked on it, it changed the value in a cell to be 1.1, and if you unselect it, changed it back to 1. There is a formula that multiplies the cell by the total to give you a 10% increase or not. When a new row is added, it made a new cell to add 1.1 to, should a 10% increase be wanted for that costing.

I have been told that the table now needs to have x number of rows so when a new row is added, there will be a new cell to determine if the new costing has the 10% increase.

Trouble is that I know how to add the 1.1 to a fixed cell but as rows can be added, the cell to determine if the price is to have the increase will change.

The table is called tblCosting and it is on a sheet called "home"

This is the code I had when there was just one row, and it was working.

Code:
Private Sub txtIncrease_Click()
Worksheets("home").Unprotect Password:="costings"
    If txtIncrease.Value = True Then
        Worksheets("home").Range("AB5").Value = "1.1"
    Else
        Worksheets("home").Range("AB5").Value = "1"
    End If

'Worksheets("home").Protect Password:="costings"
End Sub

There are things under the table so I can't use the xlup method to determine the last row to add the 1.1 or 1 to column AB.

Can someone help me with this please?
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand

Forum statistics

Threads
1,223,897
Messages
6,175,271
Members
452,628
Latest member
dd2

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