Loop Excel Borders

  • Thread starter Thread starter learning_codes
  • Start date Start date
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
 
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.
 
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
 
Back
Top