Macro to add values to named range in a certain column

smiley3141

Board Regular
Joined
Aug 13, 2010
Messages
77
Hello everyone.

I have many payment schedules that all have the same format. The range for each of the schedules has a defined name such as Customer1245. The left column of each Customer schedule is the date that a payment is due. In that row, the sixth column to the right (including the first one) is the date that the payment was received. The eighth column to the right is the check number.

Say that the value in cell A1 is "Customer1245", the value in cell B1 is the date the payment is due. The value in C1 is the date the payment was received and the value in cell D1 is the check number. Is there some way to take this information and have the Customer chart for Customer 1245 updated correctly?

Thank you for your assistance. In case it matters, I have Excel 2007.
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
Correction!

The sixth column to the right is the date the payment was received and the SEVENTH column to the right is the check number.
 
Upvote 0
I found a solution that works, as long as I change the problem a little. For each of the Customer tables, I insert a column to the right of the date. The values in this column simply number the rows in the Customer Table. Then, since I now know the row number of the named range which needs to be changed, I can use this.

To do so, Instead of only having a few cells in the range "A1:D1", I will pull the entire row data into my spreadsheet. After updating the payment as I see fit, the following Code works:

Sub change_CustomerTable_values()
'This macro changes the values in the row we want
Range("Customer1245").Rows(10).Value = Range("Customer_Payments").Value
End Sub

The above assumes that you want to change the 10th row the Customer1245 Table and that the values you want to put in those cells are a named range called "Customer_Payments")
 
Upvote 0

Forum statistics

Threads
1,207,095
Messages
6,076,551
Members
446,213
Latest member
bettigb

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