Is it possible to strike a cell value in Excel

is it possible to strike a cell value in Excel? i need change the text color to Red and Strike it.

Hi @arivazhagan_mathivan
Check this,

Happy Automation

@arivazhagan_mathivan,

Yes, this is possible using VBA code. Use Invoke VBA activity and pass this code in a text file. Change the cell address as per your need


Sub FormatCellD3()
    With Range("D3").Font
        .Strikethrough = True
        .Color = RGB(255, 0, 0) ' Red color
    End With
End Sub

1 Like

is it possible to strike the cell value?

@arivazhagan_mathivan,

Yes, give it a try on static cell and then you can make it dynamic as per need

Hi @ashokkarale
I’m facing this error not sure the reason. Can you please help on this.?

This is my workflow

Error Im getting

@arivazhagan_mathivan,

Looks like you are trying to pass ExcelProcess type variable as an argument in your project. That’s not allowed. Remove that and you should be able to run.

Are you using persistence?

sorry, Can you please be more specific? im not getting what you are mentioning. I’m not using any variable in the flow. Please help.

@arivazhagan_mathivan,

The error isn’t from the current workflow but from another workflows in your project. Check the arguments of type ExcelProcess if any.

@arivazhagan_mathivan

  1. Are you usinng any persistent activities or is it enabled in project settings?(something like wait and resume)
  2. Dont use one drive paths for keeping workflows and files being used..better use local path

Cheers

Hi @arivazhagan_mathivan

Check the below zip file and let me know if you have any questions.

Apply Red Font and Strikethrough.zip (122.5 KB)

Note: Please change the cell address in Assign activity as required

Output:

Hope it helps!!

Thanks @Parvathy
It is working.

1 Like

You’re welcome @arivazhagan_mathivan

Happy Automation!!

Test.zip (21.7 KB)

Hi @Parvathy
I’m using a similar code as yours, but I’m encountering an issue. Could you please help me understand it, if possible?

Hi @arivazhagan_mathivan
You are getting error because the argument name use passed in VBA Argument and in text file is different. Change the name in Text file and try running the code.

Regards

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