How to pass column range dynamically in excel

i want to dynamically pass column range in write range activity because the column range changes everytime according to the data i get whenever i run the flow.

please any help could be appreciated
thanks,
kaavya

@kaavya

Can you specify more about the column range dynamically?
Like are you adding any other data or how it will be

Thanks

1 Like

sure @Srini84 i have to create pivot table for two portals in one excel which i have created and for 1st portal i will have 1st day of all the sum of amount details in one column with respective id nos and after that i have to join other portal details in the same excel file but in the next of the column where the 1st portal column ends

@kaavya

Why don’t you use Append Range, Instead of Write Range?

Hope this may help you

Thanks

1 Like

i have to append column wise @Srini84

@kaavya

Write Range->Will Erase the existing data
Append Range-> Will keep the existing data and write the data under the existing data

So I didn’t understand how you are writing it column wise? Is your DT is having only one column?

If you could share some sample excel’s that would be great to understand

Thanks

1 Like

Hi Kaavya,

We can try using

  1. “Read Range” activity of the specific column u want to append data e.g dt1
  2. Get the data u want to append make the data table e.g dt2
  3. “Merge Data Table” activity for combining dt1 and dt2
  4. “Write Range” to write data with column u want

Let me know this helps

Regards
Shaf

1 Like

Hello @kaavya,

If the column has always the same name f.e: Value, use this name to join with the other datatable.

1 Like

its two diferent DTs, lets say dt1 and dt2, first i will print dt1 from the range of A3 and the row count is dynamic so in order to print dt2 i will use like this “A”+(dt1.rows.count+3).tostring why +3 is i need to give space between two Dts when i print in excel
now what i want is, i wanna print my two DTs by increasing column count
for example dt1 should take A-D columns and dt2 should continue from E-AB, here except A, all the other column ranges are dynamic so i tried to give range like this “A”+(dt1.columns.count).tostring but it dint increased as a,b,c,d and so on, it again increased by row count like A1,A2,A3 and so on.

i hope explaine better now @Angel_Llull @SHAF_MAIRAJ @Srini84

@kaavya

You can get the column count using dt.Columns.Count
After that you can refer the below to get the AB etc

You can get the count of the columns and write as below to get the result

Hope this may help you

Thanks

1 Like

thank you @Srini84 can you suggest some other ways if it is possible ?