LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default How to print the values of cells

Hi All

Below code compares and gives the result in numbers.What I want is
instead it gives number like 2 or 3 it should gives the names.So how
can I print the contents of the cells after it does sum.
Thanks for your help

Sub HCL()

Dim self As Workbook
Set self = ActiveWorkbook

Dim Table1 As Worksheet
Dim NetworkDrivers As Worksheet
Set Table1 = self.Worksheets(1)
Set NetworkDrivers = self.Worksheets(2)

Table1_usedRow = Table1.UsedRange.Row + Table1.UsedRange.Rows.Count -
1
NetworkDrivers_usedRow = NetworkDrivers.UsedRange.Row +
NetworkDrivers.UsedRange.Rows.Count - 1
NetworkDrivers_usedCol = NetworkDrivers.UsedRange.Column +
NetworkDrivers.UsedRange.Columns.Count - 1

For i = 2 To NetworkDrivers_usedRow
drivers = UCase(Trim(NetworkDrivers.Cells(i, 1)))

For j = 2 To NetworkDrivers_usedCol
project = UCase(Trim(NetworkDrivers.Cells(1, j)))
Sum = 0
For c = 2 To Table1_usedRow
If UCase(Trim(Table1.Cells(c, 8 )) = drivers Then
If UCase(Trim(Table1.Cells(c, 9))) = project Then
Sum = Sum + 1
End If
End If
Next c
NetworkDrivers.Cells(i, j) = Sum
Next j
Next i

 
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
Print worksheet but dont want two cells too print is it possible pano[_3_] Excel Programming 9 October 21st 07 02:25 PM
Only print cells with values Oldjay Excel Programming 3 May 2nd 06 04:01 PM
Print only cells with values bruce2444 Excel Worksheet Functions 0 September 15th 05 05:52 AM
How can I print current row in same place on paper but not print surrounding cells??? Andy Ford New Users to Excel 1 September 2nd 05 05:50 AM
print view & print, in excel, different size cells buddyorliz Excel Discussion (Misc queries) 3 September 1st 05 01:20 PM


All times are GMT +1. The time now is 04:48 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"