# referring to the last row of a table

#### dpaton05

##### Well-known Member
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()
If txtIncrease.Value = True Then
Worksheets("home").Range("AB5").Value = "1.1"
Else
Worksheets("home").Range("AB5").Value = "1"
End If

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

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.

Replies
1
Views
84
Replies
4
Views
96
Replies
3
Views
168
Replies
6
Views
204
Replies
6
Views
193

1,203,640
Messages
6,056,493
Members
444,870
Latest member
xuanhoi

### 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.

### Which adblocker are you using?

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

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