Stergere continut coloane

popa.catalin
Mesaje: 13
Membru din: Vin Oct 19, 2018 1:27 am

Stergere continut coloane

Mesaj de popa.catalin » Mie Mar 15, 2023 7:41 am

Buna ziua
Va rog ajutati-ma
In codul de mai jos se sterge incepand cu celula A6 continutul din randuri si toate coloanele.
Eu as dori sa se stearga continutul incepand cu A6 in jos si doar continutul din primele 4 coloane
Va multumesc frumos.


'sterge informatia veche din foaia
With Sheets("sheet2").Range("A6").CurrentRegion.Offset(6, 1)
.Borders.LineStyle = xlNone
.ClearContents
End With

Indigo-ONE
Mesaje: 437
Membru din: Mar Dec 11, 2018 8:54 pm

Re: Stergere continut coloane

Mesaj de Indigo-ONE » Mie Mar 15, 2023 10:56 am

Salut,

Testeaza:

Cod: Selectaţi tot

lastRow = Sheet2.Cells(Sheet2.Rows.Count, 1).End(xlUp).Row
With Sheets("sheet2").Range("A6:D" & LastRow)
.Borders.LineStyle = xlNone
.ClearContents
End With


"I fear the day that technology will surpass our human interaction. The world will have a generation of idiots."
Albert Einstein

popa.catalin
Mesaje: 13
Membru din: Vin Oct 19, 2018 1:27 am

Re: Stergere continut coloane

Mesaj de popa.catalin » Mie Mar 15, 2023 5:05 pm

Multumesc frumos, e super.
Asa novice cum sunt, sper sa ajut si eu pe cineva pe acest forum.
Inca odata MULTUMESC!

Indigo-ONE
Mesaje: 437
Membru din: Mar Dec 11, 2018 8:54 pm

Re: Stergere continut coloane

Mesaj de Indigo-ONE » Mie Mar 15, 2023 5:47 pm

Toti am fost începători....


"I fear the day that technology will surpass our human interaction. The world will have a generation of idiots."
Albert Einstein

Scrie răspuns

Înapoi la “Visual Basic for Application (VBA) cu Excel - Intrebari tehnice”