Copy sheet and add Location number

kenpcli

Board Regular
Joined
Oct 24, 2017
Messages
129
I am trying get a macro to look down column A and each change in site name add their location number underneath it.

Chg AmtPay AmtAdj AmtRef AmtBal Amt
Albuquerque
60Totals For AETNA$51,896.00-$31,204.59-$19,152.69$164.35$1,703.07
60Totals For BCBS$659,678.00-$320,482.96-$324,294.18$7,687.05$22,587.91
60Totals For CIGNA$264.00-$211.20-$52.80$0.00$0.00
60Totals For COMMERCIAL$20,122.00-$13,354.59-$4,563.70$0.00$2,203.71
60Totals For DSHS$8,573.00-$4,020.36-$60.64$0.00$4,492.00
60Totals For FCHN$3,774.00-$2,868.21-$905.79$0.00$0.00
60Totals For HUMANA$309.00-$167.12-$141.88$0.00$0.00
60Totals For IPN$3,923.00-$2,678.76-$1,244.24$0.00$0.00
60Totals For MEDICAID COMMERCIAL$115,651.00-$41,467.85-$57,352.41$498.51$17,329.25
60Totals For MEDICARE$1,928,300.00-$849,877.14-$1,015,188.85$3,064.69$66,298.70
60Totals For MEDICARE ADVANTAGE$440,932.00-$175,505.21-$210,678.60$2,942.08$57,690.27
60Totals For MEDICARE RR$37,253.00-$15,900.45-$20,182.52$0.00$1,170.03
60Totals For MOLINA$0.00$0.00$0.00$0.00$0.00
60Totals For MULTIPLAN$9,156.00-$4,661.86-$1,026.14$0.00$3,468.00
60Totals For SELF PAY$80,687.75-$38,452.48-$37,242.02$149.40$5,142.65
60Totals For TRICARE$39,590.00-$18,544.17-$12,423.73$921.20$9,543.30
60Totals For UNITED HEALTHCARE$237,266.00-$153,616.60-$65,164.26$1,515.56$20,000.70
60Totals For VETERANS ADMIN$23,748.00-$10,461.24-$10,419.76$0.00$2,867.00
Totals For Albuquerque$3,661,122.75-$1,683,474.79-$1,780,094.21$16,942.84$214,496.59
Bellevue
30Totals For AETNA$504,981.00-$312,837.07-$173,143.99$8,490.26$27,490.20
30Totals For CIGNA$201,832.00-$137,141.51-$43,931.99$546.69$21,305.19

<colgroup><col><col><col><col span="2"><col><col></colgroup><tbody>
</tbody>
 
it is working, I had another macro sub with the same name and it didn't like it. Can you tell me how to look down and column to the last row and put a single solid line at the top and a double solid line at the bottom of that last row? Or should I start a new thread.
 
Upvote 0

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
I had another macro sub with the same name and it didn't like it
It's best to avoid using VBA keywords as variables or Sub names, for just that reason.

For the border how about
Code:
   With Range("C" & Rows.Count).End(xlUp).Offset(, -2).Resize(, 8)
      .Borders(xlEdgeTop).LineStyle = xlContinuous
      .Borders(xlEdgeBottom).LineStyle = xlDouble
   End With
This uses Col C to find the last used row
 
Upvote 0
Glad to help & thanks for the feedback
 
Upvote 0
How do I get to go under the last row instead of highlight the last row? Sorry I wasn't more specific.
 
Upvote 0
Simply change the first line to
Code:
With Range("C" & Rows.Count).End(xlUp).Offset([COLOR=#ff0000]1[/COLOR], -2).Resize(, 8)
 
Upvote 0
Fluff, one more question. That put borders at the very bottom of my data. But I have a 3 row between data that I need the same lines for. Can you help?
 
Upvote 0

Similar threads

Forum statistics

Threads
1,215,358
Messages
6,124,487
Members
449,165
Latest member
ChipDude83

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