VBA for Conditional Formatting (Borders) and Center Across Selection

robertmwaring2

Board Regular
Joined
Mar 8, 2019
Messages
132
Office Version
  1. 365
Platform
  1. Windows
Hello All,
I appologize in advance that I am COMPLETELY NEW to VBA - with no real knowledge. I just finished creating a spreadsheet (sheet name is "Production Sheet") that i am in the process of creating a userform for. I had everything formatted as I liked, but came across an issue when the sheet was more than 1 page long. I formatted everything up to 10 pages, but I may not need to print 10 pages, only those with information. I am trying to format each row (beginning with A8) ending at Column J. I need each cell in each row to have a border if there is information in Column A of that row.
Example: If A8<>"", each cell from A8:J8 has a border (just basic default border). There could be times when only 5 rows will be used (A8:J12) but times when 50 may be used (A8:J57) or more. If it is not used, it should remain blank.
I am also trying to center information across a selection in two separate area within each row. For example, the information that will be put into A8, should be centered across A8:D8 and the information in G8 should be centered across G8:I8. I need the same principles to apply to all rows 8 and beyond (for border and centering).
I have tried to figure this count via MANY forums but cannot mix and match what I need to accomplish it without errors if it works a all. If anyone can help, I would greatly appreciate it.
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
so over the forums what worked best but wasn't quite there, post the code between code tags and describe what didn't succeed
 
Upvote 0
I appreciate your quick response, but to be honest, I can't say what it was at this point. I've deleted evrerything I've tried (sorry). I know next to nothing about VBA coding and am attempting to learn as I go (thats how i learned excel functions/formulas - but clearly not the way to go with VBA).
 
Upvote 0

Forum statistics

Threads
1,224,819
Messages
6,181,153
Members
453,021
Latest member
Justyna P

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