Cell Border in VBA

Solved
Grobibi34 Posted messages 83 Status Member -  
 seb -
Hello everyone.

I am currently developing a small automated planning tool, so my rows and columns are variable.

I would like all the cells I have edited to have a border.

I imagine that the problem would be to scan through all the cells row by row or column by column to see if there is anything written in them; if so, we would border the cell in question.

Am I correct in principle? If so, how can I achieve this, and if not, how should I proceed?

Best regards,

Grobibi34
Configuration: Windows XP Internet Explorer 6.0

7 answers

michel_m Posted messages 18903 Registration date   Status Contributor Last intervention   3 320
 
Hello

your table is in the area B2:H25 for example

Sub encadrer_si() Dim cellule As Range For Each cellule In Range("B2:H25") If cellule <> "" Then cellule.Borders.Weight = xlThin Next End Sub


--
:-x
37
altec
 
Thank you very much!
0