Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I have a variable assigned a value as follows: Dim MemberNumber As Integer Dim MemberName as Text MemberNumber = Cell MemberName = Cell.Offset(1, 0) Cell.Offset(1, 1) = BusinessName & " " & MemberNumber How can I set the member number to be bolded? Thanks so very much! mikeburg -- mikeburg ------------------------------------------------------------------------ mikeburg's Profile: http://www.excelforum.com/member.php...o&userid=24581 View this thread: http://www.excelforum.com/showthread...hreadid=514176 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I presume
Cell.Offset(1, 1) = BusinessName & " " & MemberNumber should be Cell.Offset(1, 1) = memberName & " " & MemberNumber I'm not clear which cell you want to make bold, bot one of Cell.Font.Bold = True or Cell.Offset(1,1).Font.Bold = True should do it. mikeburg wrote: I have a variable assigned a value as follows: Dim MemberNumber As Integer Dim MemberName as Text MemberNumber = Cell MemberName = Cell.Offset(1, 0) Cell.Offset(1, 1) = BusinessName & " " & MemberNumber How can I set the member number to be bolded? Thanks so very much! mikeburg -- mikeburg ------------------------------------------------------------------------ mikeburg's Profile: http://www.excelforum.com/member.php...o&userid=24581 View this thread: http://www.excelforum.com/showthread...hreadid=514176 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I think the OP wants to make part of the cell Bold and part Normal. I
don't know how to do this from VBA, but then there's a whole lot about VBA that I don't know. Bill --------------------------------- On 19 Feb 2006 12:52:00 -0800, Andrew Taylor wrote: I presume Cell.Offset(1, 1) = BusinessName & " " & MemberNumber should be Cell.Offset(1, 1) = memberName & " " & MemberNumber I'm not clear which cell you want to make bold, bot one of Cell.Font.Bold = True or Cell.Offset(1,1).Font.Bold = True should do it. mikeburg wrote: I have a variable assigned a value as follows: Dim MemberNumber As Integer Dim MemberName as Text MemberNumber = Cell MemberName = Cell.Offset(1, 0) Cell.Offset(1, 1) = BusinessName & " " & MemberNumber How can I set the member number to be bolded? Thanks so very much! mikeburg -- mikeburg ------------------------------------------------------------------------ mikeburg's Profile: http://www.excelforum.com/member.php...o&userid=24581 View this thread: http://www.excelforum.com/showthread...hreadid=514176 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Mike,
Cell.Offset(1, 1).Characters(Len(BusinessName) + 1, _ Len(Str(MemberNumber))).Font.Bold = True -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "mikeburg" wrote in message ... I have a variable assigned a value as follows: Dim MemberNumber As Integer Dim MemberName as Text MemberNumber = Cell MemberName = Cell.Offset(1, 0) Cell.Offset(1, 1) = BusinessName & " " & MemberNumber How can I set the member number to be bolded? Thanks so very much! mikeburg -- mikeburg ------------------------------------------------------------------------ mikeburg's Profile: http://www.excelforum.com/member.php...o&userid=24581 View this thread: http://www.excelforum.com/showthread...hreadid=514176 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
A better bit of code is
Cell.Offset(1, 1).Characters(Len(BusinessName) + 1, _ Len(Str(MemberNumber))).Font.Bold = True -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Chip Pearson" wrote in message ... Mike, Cell.Offset(1, 1).Characters(Len(BusinessName) + 1, _ Len(Str(MemberNumber))).Font.Bold = True -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "mikeburg" wrote in message ... I have a variable assigned a value as follows: Dim MemberNumber As Integer Dim MemberName as Text MemberNumber = Cell MemberName = Cell.Offset(1, 0) Cell.Offset(1, 1) = BusinessName & " " & MemberNumber How can I set the member number to be bolded? Thanks so very much! mikeburg -- mikeburg ------------------------------------------------------------------------ mikeburg's Profile: http://www.excelforum.com/member.php...o&userid=24581 View this thread: http://www.excelforum.com/showthread...hreadid=514176 |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Sun, 19 Feb 2006 14:35:20 -0600, mikeburg
wrote: I have a variable assigned a value as follows: Dim MemberNumber As Integer Dim MemberName as Text MemberNumber = Cell MemberName = Cell.Offset(1, 0) Cell.Offset(1, 1) = BusinessName & " " & MemberNumber How can I set the member number to be bolded? Thanks so very much! mikeburg A little tough to tell what you're doing, since your Dim's don't make sense to me. But in order to bold a portion of the contents of a cell, the contents needs to be a text string, and you then use the characters property. So in your example, to bold MemberNumber, you would use something like: With [a1].Offset(1, 1) .Value = businessname & " " & MemberNumber .Characters(Len(.Value) - Len(MemberNumber) + _ 1, Len(MemberNumber)).Font.Bold = True End With --ron |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Thanks a million for your responses. I was only wanting to bold the member number part of the cell. Your replies were working but the BusinessNumber was not bolding when the BusinessName was sometimes blank (no business name existed), but the last reply worked great! Thanks so much. mikeburg -- mikeburg ------------------------------------------------------------------------ mikeburg's Profile: http://www.excelforum.com/member.php...o&userid=24581 View this thread: http://www.excelforum.com/showthread...hreadid=514176 |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Sun, 19 Feb 2006 16:42:03 -0600, mikeburg
wrote: Thanks a million for your responses. I was only wanting to bold the member number part of the cell. Your replies were working but the BusinessNumber was not bolding when the BusinessName was sometimes blank (no business name existed), but the last reply worked great! Thanks so much. mikeburg Glad to help. Thanks for the feedback. --ron |
#9
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Both of Chip's worked for me whether Cell.Offset(1,0) was empty or not when
I corrected your code to use the correct variable name. Maybe a little more thorough testing on your part would be beneficial. -- Regards, Tom Ogilvy "mikeburg" wrote in message ... Thanks a million for your responses. I was only wanting to bold the member number part of the cell. Your replies were working but the BusinessNumber was not bolding when the BusinessName was sometimes blank (no business name existed), but the last reply worked great! Thanks so much. mikeburg -- mikeburg ------------------------------------------------------------------------ mikeburg's Profile: http://www.excelforum.com/member.php...o&userid=24581 View this thread: http://www.excelforum.com/showthread...hreadid=514176 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Add only cells whose contents are in "Bold" | Excel Discussion (Misc queries) | |||
change cell contents to bold | Excel Worksheet Functions | |||
clear cells unless contents are in bold | Excel Programming | |||
Bold some of the cell contents | Excel Programming | |||
Dump of all variable contents | Excel Programming |