Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 72
Default Bolding variable cell

I'm using this code to add the words "Total" and "Items" in column A at the
end of a report I download each day with variable number of rows each day.
In column B I have the dollar amount on the same row as Total and the count
of rows next to Items. I need to add code to the below to convert these four
cells (which I can not identifiy the location of since the report varies each
day) to bold and the count number in column B needs to be text, it is
currently coming in as currency since that is how the column is formatted.
Your help is appreciated, thank you

Set rng = Cells(Rows.Count, 2).End(xlUp)

rng.Offset(2, -1).Value = "Total"
rng.Offset(3, -1).Value = "Items"

rng.Offset(2, 0).Value = Application.Sum(Range("B1", rng))
rng.Offset(3, 0).Value = Application.Count(Range("B1", rng))

Columns("A:I").Select
Columns("A:I").EntireColumn.AutoFit
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Bolding variable cell


Hi there,

If I understand correctly you've done hte hard part already and already
identified your cells when you enter your headigns and values. All you
need do further is change the format of the cell.

Set rng = Cells(Rows.Count, 2).End(xlUp)

rng.Offset(2, -1).Value = "Total"
rng.Offset(2, -1).Font.Bold = True

rng.Offset(3, -1).Value = "Items"
rng.Offset(3, -1).Font.Bold = True

rng.Offset(2, 0).Value = Application.Sum(Range("B1", rng))
rng.Offset(2, 0).Font.Bold = True

rng.Offset(3, 0).Value = Application.Count(Range("B1", rng))
rng.Offset(3, 0).Font.Bold = True

Columns("A:I").Select
Columns("A:I").EntireColumn.AutoFit


I think that does it.

Good luck, Tris


--
Tristan
------------------------------------------------------------------------
Tristan's Profile: http://www.excelforum.com/member.php...o&userid=34061
View this thread: http://www.excelforum.com/showthread...hreadid=548773

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Bolding variable cell


Oops

Sorry forgot about the currency thing....


rng.Offset(3, 0).Value = Application.Count(Range("B1", rng))
rng.Offset(3, 0).Font.Bold = True
rng.Offset(3, 0).NumberFormat = "General"

If general doesn't do the job try swapping it for "Text"


--
Tristan
------------------------------------------------------------------------
Tristan's Profile: http://www.excelforum.com/member.php...o&userid=34061
View this thread: http://www.excelforum.com/showthread...hreadid=548773

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 72
Default Bolding variable cell

This worked great, thanks a bunch. I just realized I have one other
spreadsheet that I just need the sum in column A for the entire column. I've
tried manipulating this code, but it's not working for me. Again it is an
unknown cell because the report varies in length each day.

"Tristan" wrote:


Oops

Sorry forgot about the currency thing....


rng.Offset(3, 0).Value = Application.Count(Range("B1", rng))
rng.Offset(3, 0).Font.Bold = True
rng.Offset(3, 0).NumberFormat = "General"

If general doesn't do the job try swapping it for "Text"


--
Tristan
------------------------------------------------------------------------
Tristan's Profile: http://www.excelforum.com/member.php...o&userid=34061
View this thread: http://www.excelforum.com/showthread...hreadid=548773


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Bolding variable cell

I need to show on an invoice, the total amount of the transaction in dollars,
but also must have this amount written our in words. Example:

125.00 ONE HUNDRED TWENTY FIVE AND ZERO CENTS

thanks,

Peter Hoffmann


"JOUIOUI" wrote:

This worked great, thanks a bunch. I just realized I have one other
spreadsheet that I just need the sum in column A for the entire column. I've
tried manipulating this code, but it's not working for me. Again it is an
unknown cell because the report varies in length each day.

"Tristan" wrote:


Oops

Sorry forgot about the currency thing....


rng.Offset(3, 0).Value = Application.Count(Range("B1", rng))
rng.Offset(3, 0).Font.Bold = True
rng.Offset(3, 0).NumberFormat = "General"

If general doesn't do the job try swapping it for "Text"


--
Tristan
------------------------------------------------------------------------
Tristan's Profile: http://www.excelforum.com/member.php...o&userid=34061
View this thread: http://www.excelforum.com/showthread...hreadid=548773




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Bolding variable cell

http://xcell05.free.fr/

Laurant Longre's site. Download MoreFunc.xll. It has a detailed help file.
It contains a function that will do this

--
Regards,
Tom Ogilvy


" wrote in
message ...
I need to show on an invoice, the total amount of the transaction in
dollars,
but also must have this amount written our in words. Example:

125.00 ONE HUNDRED TWENTY FIVE AND ZERO CENTS

thanks,

Peter Hoffmann


"JOUIOUI" wrote:

This worked great, thanks a bunch. I just realized I have one other
spreadsheet that I just need the sum in column A for the entire column.
I've
tried manipulating this code, but it's not working for me. Again it is
an
unknown cell because the report varies in length each day.

"Tristan" wrote:


Oops

Sorry forgot about the currency thing....


rng.Offset(3, 0).Value = Application.Count(Range("B1", rng))
rng.Offset(3, 0).Font.Bold = True
rng.Offset(3, 0).NumberFormat = "General"

If general doesn't do the job try swapping it for "Text"


--
Tristan
------------------------------------------------------------------------
Tristan's Profile:
http://www.excelforum.com/member.php...o&userid=34061
View this thread:
http://www.excelforum.com/showthread...hreadid=548773




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
Bolding Specific Cell Formula Question bodhisatvaofboogie Excel Discussion (Misc queries) 1 May 19th 06 03:06 PM
Running a variable macro when any value is entered into a variable cell [email protected] Excel Programming 3 December 14th 05 05:15 PM
Bolding Row from VB6 Ian B[_2_] Excel Programming 4 July 9th 05 11:19 PM
Bolding when subtotalling mrsteve1 Excel Worksheet Functions 2 February 17th 05 11:26 PM
Bolding Dale[_12_] Excel Programming 2 September 30th 04 04:21 PM


All times are GMT +1. The time now is 02:51 AM.

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"