How to delete the first part of sheet

Hi everyone,

I have this type of sheet and I would like to delete the first part up to the table but sometimes the table starts at A27 others at A26 and so on.
How can I delete the first part if the beginning of the table always changes?

How can I do that?
Thanks in advance

and I would the result like this:

Use LookUp Range in that search for “Column1” output in variable as LookUP
It will give you the cell no say A27
Then assign Variable say Num=LookUP.Substring(1)
then use below code in Invoke VBA

Sub Macro2(LookUP)
Rows(“1:” & LookUP).Select
Selection.Delete Shift:=xlUp
End Sub

2 Likes

@salvatore.quimi Check this workflow:
Remove Unwanted Rows.zip (7.7 KB)

Check the excel File First. Execute the Workflow. Check the Excel, the unwanted rows should be deleted.

hi @ImPratham45 but if i use your code I immediately this error:

what you have pass in Excel Application Scope file name?

the path of my file excel

Is it contains any variable?
Coz error says there is an field data which does not contains a value

no, I did as your suggestion like this:

Maybe the Lookup activity is wong

hi @supermanPunch I tried your method and it is fast and effective, thanks

1 Like

Check whether your lookup range gives a value or not by using Message box
If it not then u will get Object reference error

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.