I am trying to remove characters in a string but having some issues
the part of the string is_dil50
the dil50 could be dil1000 or dil5000 or any other values
If I try using_dil* with the * as a variable it does not work unless I have dil* in the cell
How can I use a variable please
the code is below
'Strip _dil from sample name to open sample workbook
the_string = Sheets("PFAS Data").Range("D1")
the_string = Replace(the_string, "_dil50", "")
Sheets("PFAS Data").Range("D1") = the_string
Openname = ActiveSheet.Range("D1").Text
the part of the string is_dil50
the dil50 could be dil1000 or dil5000 or any other values
If I try using_dil* with the * as a variable it does not work unless I have dil* in the cell
How can I use a variable please
the code is below
'Strip _dil from sample name to open sample workbook
the_string = Sheets("PFAS Data").Range("D1")
the_string = Replace(the_string, "_dil50", "")
Sheets("PFAS Data").Range("D1") = the_string
Openname = ActiveSheet.Range("D1").Text
Last edited: