Formatting Cells via Macro

  • Thread starter Thread starter degsy70
  • Start date Start date
D

degsy70

Hi, I am trying to write a macro that does the following:

We have spreadsheets where dynamic data starts on row 8. There wil
then be x number of rows after that (not always same number of rows)
After the last row of data there is then a blank row and then the nex
row has static data in it.
I need to be able to generate a macro that puts borders around al
cells in rows 8 to x but only those rows containing dynamic data.
I.e. start at row 8, put borders into cells in all subsequent rows bu
stop when you get to the first blank row.

Can anyone help??

Using Excel 200
 
set rng = Range(Cells(8,1),Cells(8,1).End(xldown))
rng.Resize(,10).BorderAround Weight:=xlThin

if the data will be contiguous in column A.

Another

If row 7 is blank

range("A8").currentRegion.BorderAround Weight:=xlThin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top