If table header is not available means i have to take tablehaeder from previous sheet

Here I’m sharing a sample excel in every sheets contains data. In column “O1” I’m mentioning the table name, If any sheet does not contain table name means it has to take table name of previous sheet. Data
SampleExcelsheet.xlsx (10.9 KB)
are updating based on the table header name. Can any one please help me to solve this issue

Hi @Chippy_Kolot
If sheet is empty should it be update with previous one?

Yes correct

@Chippy_Kolot I am trying to solve your problem
UpdateTableName.xaml (11.2 KB)
please check

HI @Chippy_Kolot

Checkout this Xaml file

Main.xaml (12.9 KB)
SampleExcelsheet.xlsx (10.3 KB)


Kindly refer to this Xaml file, you may get some idea
Forum_Excel_Sheet_Loop.zip (81.2 KB)

Kindly refer to this XAML file
Forum_Excel_Sheet_Loop_WriteHeader.zip (80.4 KB)
From the above flow you can write the header in O1 based on pervious header


Overciew of the steps are

  • Initializing new list called Tablename
  • First iam getting all the sheets with get workbook sheets activity and store in sheets
  • For Each sheets
    • Reading the cell “O1” and store in “StrTablename”
    • Checking if the variable StrTablename is empty
      • True-> Write the tablename which is last in the list Tablename
      • False-> Add the table name to the collections of list “Tablename”


@Chippy_Kolot The only problem is

if in case you have empty cell in the very first sheet you may receive error.

For that while initializing the Tablename

you should initialize like this

New List(Of String)(New String() {“-”})

attaching the new xaml file for your ref
Main_ModifiedInit.xaml (12.9 KB)
SampleExcelsheet.xlsx (10.3 KB)