Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Bold contents of a variable


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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 225
Default Bold contents of a variable

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 105
Default Bold contents of a variable

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Bold contents of a variable

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Bold contents of a variable

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,651
Default Bold contents of a variable

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Bold contents of a variable


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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,651
Default Bold contents of a variable

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Bold contents of a variable

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Add only cells whose contents are in "Bold" oisinirish Excel Discussion (Misc queries) 3 February 22nd 09 07:30 PM
change cell contents to bold dave@penneys Excel Worksheet Functions 5 September 20th 07 08:25 PM
clear cells unless contents are in bold John Jones Excel Programming 1 August 24th 05 01:07 PM
Bold some of the cell contents Brad Excel Programming 4 April 25th 05 04:49 PM
Dump of all variable contents Bernie Deitrick Excel Programming 0 February 20th 04 04:18 PM


All times are GMT +1. The time now is 12:30 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"