Learner007
(Uipath Learner)
August 29, 2023, 4:36pm
1
Hi everyone,
I have a scenario in Excel, i want to delete columns in Excel starting from F column and i don’t know how many columns will be . I want to delete columns starting from F to till end.
Can anyone help me how can I do this.
I want solution except Macro and VBA code.
@Learner007
you can use Read range activity by mentioning the range
cheers
Vikas_M
(Vikas M)
August 29, 2023, 4:54pm
3
Hey @Learner007 ,
Yourdatatablename = Yourdatatablename.DefaultView.ToTable(False,"columnnameA", "columnnameB", "columnnameC","columnnameD","columnnameE").copytodatatable()
Replace those with Your column name till e
And it will not write other than mentioned columns
Hope it helps you out!
Learner007
(Uipath Learner)
August 29, 2023, 5:00pm
4
Hi @Shiva_Nikhil if I want to use delete range means i need end column but I don’t know how many columns i will be getting in that excel
Learner007
(Uipath Learner)
August 29, 2023, 5:01pm
5
Hi @Vikas_M I’m getting error like copytodatatable is not a member of datatable
Actually I can’t specify the column names because in between few columns are empty how to handle that
@Learner007
try to make use of readrange activity and make the range upto which you want
Vikas_M
(Vikas M)
August 29, 2023, 5:05pm
7
hey @Learner007 , My bad
copytoDatatable was not required
This above works
Also if you don’t want to specify column names, then while reading from excel specify the range
Refer below image
Learner007
(Uipath Learner)
August 29, 2023, 5:05pm
8
Thanks @Vikas_M it worked. Read range only.
1 Like
system
(system)
Closed
September 1, 2023, 5:06pm
9
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.