Excel, limpiar rango

hola, alguien me puede orientar para poder borrar la informacion de una hoja de excel, incluido encabezados pero que no borre el color ni estilo, ni tampoco formulas en las celdas…
intente con (imagen adjunta)

pero borra todo todo, y necesito que deje colores y formulas en celdas…
ayuda

Hi @mively

Try this,
Open the Excel file using the “Excel Process Scope” and “Use Excel File” activities. Use the “Invoke VBA” activity and insert the following VBA code(change accordingly):

Sub ClearSheetData()
Dim ws As Worksheet
Set ws = ActiveSheet
ws.Cells.ClearContents
End Sub

Happy Automation

Hii @mively
try this approach modern excel activities
follow the below steps

1 Use “Use Excel File”

  • Open the Excel file using the “Use Excel File” activity.

2 Read the Data

  • Use “For Each Excel Row” to iterate through each row dynamically.

3 Loop Through Each Column

  • Inside “For Each Excel Row”, use “For Each” to iterate through columns.

4 Check for Formulas

  • Use “Get Cell Formula” to check if a formula exists in each cell.

5 Clear Non-Formula Cells

  • If the formula is empty, use “Write Cell” to set the cell value to "".

    cheers!!
    


lo podrias graficar para eliminar solo ciertas columnas, por ejemplo escribir “” de la A a la J, en el for each, please

@mively

after using of for each row in datatable use the below steps

  • Inside For Each Excel Row use a for Eachloop but limit it to columns A to J.
  • Convert column index to a letter using UiPath’s column conversion logic

cheers!!