Excel macro: how do I change all row heights, BUT if cell.value = bold make the cell height bigger?
Tag : excel , By : bikefixxer
Date : March 29 2020, 07:55 AM
Does that help I'm working on a long list of data (Column B) that has been formatted using bold and indents. The bold cells contain the titles/category names and the indented cell values are the subcategories. Sub setHeights()
Dim targetRange As Range
Dim targetCell As Range
Set targetRange = Range("B:B")
For Each targetCell In targetRange
If Not IsEmpty(targetCell) Then
If targetCell.Font.Bold Then
targetCell.RowHeight = 15
ElseIf targetCell.Font.Superscript Then
targetCell.RowHeight = 12.75
Else
targetCell.RowHeight = 10.5
End If
End If
Next targetCell
End Sub
|
Excel cell html bold tags to bold font
Tag : excel , By : Jim Davis
Date : March 29 2020, 07:55 AM
Any of those help I need to replace in a Excel cell string, all html bold tagged substrings with bold font and remove the tags. I guess I need to loop through the string somehow, at the same time removing tags and setting font like this: , OK. Did it myself. This only works with bold tags. xlWs.Cells(1, 2).value = StripTags("this <b>should</b> be <b>bold</b>")
Dim toBold As String = "this <b>should</b> be <b>bold</b>"
Dim i As Integer = 0
Dim loopcount As Integer = 0
While i > -1
Dim startTag As Integer = toBold.IndexOf("<b>", i)
If startTag = -1 Then Exit While
Dim endTag As Integer = toBold.IndexOf("</b>", i)
toBold.Remove(startTag, 3)
toBold.Remove(endTag, 4)
xlWs.Cells(1, 2).characters(startTag + 1 - (loopcount * 7), endTag - startTag - 3).font.bold = True
loopcount += 1
i = endTag + 1
End While
Function StripTags(ByVal html As String) As String
Return Regex.Replace(html, "<.*?>", "")
End Function
|
Trying to get my span text to be bold and have a bigger font
Tag : html , By : Luciano Campos
Date : March 29 2020, 07:55 AM
hope this fix your issue I'm trying to get my span to be bold and have a different font than my paragraph. The CSS is correctly linked to my html. , You need to specify class keyword span=bold doesn't mean anything span.bold {
font-size: 20px;
font-weight: 700;
}
p {
font-size: 16px;
color: black;
font-family: sans-serif;
padding: 22px;
max-width: 60%;
display: inline-block;
margin-top: 0px;
}
<p align="center">
<span class="bold">Welcome to Coding Club for Web Developers</span> <br> Coding Club web developers is specifically designed to teach the basics of making a website by learning HTML, Javascript, and CSS. Using Discord, we talk with our team to learn from each other and
to design for our upcoming projects. As a beginner or an amateur, you'll learn everything you need to know about Web Development. To practice, you can go to W3Schools, Sololearn, or Codecademy. <br>
|
How to make the font of each bold character in a document 4 points bigger
Tag : vba , By : Jim Davis
Date : March 29 2020, 07:55 AM
I wish this helpful for you There are a couple of issues with the code in the question, that aren't really intuitive to recognize. There is no Character data type in the Word object model, only Characters A Character object is of the data type Range So: Dim char as Range A Character object is not equivalent to a Paragraph object, so the For...Each enumeration For Each char in searchRange.Paragraphs triggers a "Type Mismatch". It's necessary to loop searchRange.Characters. Dim char As Word.Range
Dim searchRange As Range
Set searchRange = Selection.Range
searchRange.End = ActiveDocument.content.End
For Each char In searchRange.Characters
If char.Font.Bold = True Then
char.Font.Size = char.Font.Size + 4
End If
Next char
|
Formatting a text in a table cell with PHPWord e.g. bold, font, size e.t.c
Tag : php , By : user171555
Date : March 29 2020, 07:55 AM
|