Loop Excel Borders

L

learning_codes

Hi,

I have 50 spreadsheets that have one worksheet. I have all the data
in each spreadsheet but only first (1 of 50) has the lines. This is
what I want but I am not able to get all next 49 spreadsheet does not
have the lines.


Can you help me and how to create all the spreadsheets that have
lines?


Your help would be much appreciated.


Here is the code below:


'*********************************************************************
For Each cell In Range("A4", Range("A65536").End(xlUp))
If cell.Value > "" Then
With Range(cell, cell.Offset(0, 9))


With .Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With .Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With .Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With .Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With .Borders(xlInsideVertical)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With


End With


End If
Next
 
S

Shane Devenshire

Hi,

If there are only 50 sheets, right-click a sheet tab and choose Select All
Sheets. Add the borders you want. (they will be added to all 50 sheets).
Right-click any tab and choose Ungroup Sheets.
 
L

learning_codes

Hi,

If there are only 50 sheets, right-click a sheet tab and choose Select All
Sheets.  Add the borders you want. (they will be added to all 50 sheets).  
Right-click any tab and choose Ungroup Sheets.

--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire













- Show quoted text -

I created a database to export excel and i have 50 files not 50
worksheets in one file. I'm looking for the loop for this
border.

Thanks
 

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

Top