Answer the question
In order to leave comments, you need to log in
How to make part of text bold in VB (LibreOffice)?
Good afternoon. I am not a programmer. There is a LibreOffice table with a built-in WB macro.
The macro takes the values from sheet 1, combines them and puts them in the cells of sheet 2, forming the text:
Product
CODE
How to change it so that the CODE is bold (value &sCode)? Is it possible at all?
Thank you!
----------------
File: https://dl.dropboxusercontent.com/u/8476699/toster...
Code separately:
sub Labeller
Dim oDoc As Object, oSheet As Object,
oCell As Object,
sCode as String, sProduct as String, i as Integer,
j
as Integer, n as Integer, m as Integer 0)
sProduct = oCell.getString()
oCell = oSheet.getCellByposition(2,1)
n = (oCell.getValue()-1)
if n<0 then
n=0
endif
m = getLastUsedRow(oSheet)
for i = 0 to (m /3)
for j = 0 to 2
oSheet = oDoc.Sheets.getByName("Source")
oCell = oSheet.getCellByposition(0,n)
sCode = oCell.getString()
oSheet = oDoc.Sheets.getByName("Labels")
oCell = oSheet.getCellByposition(j,i)
oCell.setString(sProduct & CHR$(10) & CHR$(10) & CHR$(10) &sCode)
if n = m then
exit sub
end if
n = n + 1
next j
next i
end sub Function
getLastUsedRow
(
oSheet as Object) as Integer
Dim
oCell As Object, oCursor As Object, aAddress As
Variant .RangeAddress
GetLastUsedRow = aAddress.EndRow
End Function
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question