Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Font Object
How do I set the font property of a cell / range to be the same as a
reference cell, without going through all the myriad of font properties and setting individually I have tried all manner of variations on the theme: dim oFont as Font set oFont = RefRange.Font TargetCell.Font = oFont Does not work and all manner of mucking around has not improved results Thanks Jack |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Font Object
Try this piece of code for copying format of cell A1 to B1:
Range("A1").Copy Range("B1").PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _ SkipBlanks:=False, Transpose:=False Application.CutCopyMode = False Regards, Stefi €˛Jack Clift€¯ ezt Ć*rta: How do I set the font property of a cell / range to be the same as a reference cell, without going through all the myriad of font properties and setting individually I have tried all manner of variations on the theme: dim oFont as Font set oFont = RefRange.Font TargetCell.Font = oFont Does not work and all manner of mucking around has not improved results Thanks Jack |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Font Object
You can't copy the font object in one go. So other than PasteSpecial formats
as suggested by Stefi, which could also copy up to 30 other non font related cell properties, you're stuck with setting font attributes individually. Regards, Peter T "Jack Clift" wrote in message ... How do I set the font property of a cell / range to be the same as a reference cell, without going through all the myriad of font properties and setting individually I have tried all manner of variations on the theme: dim oFont as Font set oFont = RefRange.Font TargetCell.Font = oFont Does not work and all manner of mucking around has not improved results Thanks Jack |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Font Object
Thanks Stefi and Peter,
Can either of you provide an explanation as to why you cannot assign the font object as per any other object? Just for my info? Will use solution as suggested Thanks for the timely reply Regards JC "Peter T" wrote: You can't copy the font object in one go. So other than PasteSpecial formats as suggested by Stefi, which could also copy up to 30 other non font related cell properties, you're stuck with setting font attributes individually. Regards, Peter T "Jack Clift" wrote in message ... How do I set the font property of a cell / range to be the same as a reference cell, without going through all the myriad of font properties and setting individually I have tried all manner of variations on the theme: dim oFont as Font set oFont = RefRange.Font TargetCell.Font = oFont Does not work and all manner of mucking around has not improved results Thanks Jack |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Font Object
Default property excepting, I can't think of any object type you can simply
assign to another object in the way you suggest, could you give an example of what you had in mind. Regards, Peter T "Jack Clift" wrote in message ... Thanks Stefi and Peter, Can either of you provide an explanation as to why you cannot assign the font object as per any other object? Just for my info? Will use solution as suggested Thanks for the timely reply Regards JC "Peter T" wrote: You can't copy the font object in one go. So other than PasteSpecial formats as suggested by Stefi, which could also copy up to 30 other non font related cell properties, you're stuck with setting font attributes individually. Regards, Peter T "Jack Clift" wrote in message ... How do I set the font property of a cell / range to be the same as a reference cell, without going through all the myriad of font properties and setting individually I have tried all manner of variations on the theme: dim oFont as Font set oFont = RefRange.Font TargetCell.Font = oFont Does not work and all manner of mucking around has not improved results Thanks Jack |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Syntax for changing font color in a Shapes object | Excel Programming | |||
Changed default font, previous font still shows when editing | Excel Discussion (Misc queries) | |||
Changed default font, previous font still shows when editing | Excel Discussion (Misc queries) | |||
VBA Font Object Query | Excel Programming | |||
Dropdown list for font size, font type and number formats | Excel Programming |