Excel Macro to find text in cell and insert hyperlink on cell
Date : March 29 2020, 07:55 AM
help you fix your problem As mentioned in a comment, Excel doesn't seem to support multiple hyperlinks in a cell. The code below will do the replacement from ticket to link: Option Explicit
Sub loop_over_cells()
Dim a_cell
Dim replaced As String
For Each a_cell In ActiveSheet.UsedRange
Debug.Print "old value " & a_cell.Value
replaced = RegexReplace(a_cell.Value, "(fd-\d{4}\b)", "=hyperlink(" & Chr(34) & "http://cnn.com/$1" & Chr(34) & ")")
a_cell.Value = replaced
Debug.Print "new value " & a_cell.Value
Next
End Sub
Function RegexReplace(search_string, ptrn, rplc)
Dim regEx
Set regEx = CreateObject("VBScript.RegExp")
regEx.Pattern = ptrn
regEx.IgnoreCase = True
regEx.Global = True
RegexReplace = regEx.replace(search_string, rplc)
End Function
|
Google apps script: Insert inlineImage and text into Table Cell and modify text in the cell
Date : March 29 2020, 07:55 AM
Hope that helps What I am trying to do is create a table in a Google Doc using Google apps script and (1) insert an inlineImage into a cell (while limiting the size of the image to about 120 pixels wide). Then I would like to (2) insert text into the same cell underneath the image and modify the font size of the text. , For this you can create a cell variable as var cells = [['Row 1, Cell 1', 'Row 1, Cell 2', 'Row 1, Cell 3'],
['Row 2, Cell 1', 'Row 2, Cell 2', 'Row 2, Cell 3']];
|
Change cell background color based on cell's text in excel using C# EPPlus
Date : March 29 2020, 07:55 AM
will help you Here's a couple of different ways of achieving it. With a formula expression, you need to use the format C2="In Progress", where C2 is the top cell in the range in which the conditional formatting applies - it will still apply to other cells in the range in the right way. var formatExpressionInProgress = worksheet.ConditionalFormatting.AddExpression(new ExcelAddress("C2:C5"));
formatExpressionInProgress.Formula = "C2=\"In Progress\"";
formatExpressionInProgress.Style.Fill.PatternType = ExcelFillStyle.Solid;
formatExpressionInProgress.Style.Fill.BackgroundColor.Color = Color.Yellow;
var formatExpressionCompleted = worksheet.ConditionalFormatting.AddEqual(new ExcelAddress("C2:C5"));
formatExpressionCompleted.Formula = "\"Completed\"";
formatExpressionCompleted.Style.Fill.PatternType = ExcelFillStyle.Solid;
formatExpressionCompleted.Style.Fill.BackgroundColor.Color = Color.Green;
|
C# to change the background color of a ASP:Gridview cell based on text in that same cell
Tag : chash , By : Kaputnik
Date : March 29 2020, 07:55 AM
|
Google Spreadsheet: Script to Change One Cell's Background Color when Another Cell Changes Text
Date : March 29 2020, 07:55 AM
|