Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default How to print the values of cells

why not one statement

NetworkDrivers.UsedRange.printout


"tannu" wrote:

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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default How to print the values of cells

Hi Joel
Thank for your reply.
I don't want to print the results ,what I want to say is.

My code compares two values that is network drivers(second xls sheet)
with table1(first xls sheet) then it results in numeric numbers.
Say example particular network driver is cell 1 of network drivers.xls
is used 3 times in table1.So the 3 times is for a particular feature.
So I want it to display the feature name instead of the numeric 3.

Thanks for your help.


On Aug 30, 4:16*pm, Joel wrote:
why not one statement

NetworkDrivers.UsedRange.printout



"tannu" wrote:
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- Hide quoted text -


- Show quoted text -


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default How to print the values of cells

Where is the feature name located?

"tannu" wrote:

Hi Joel
Thank for your reply.
I don't want to print the results ,what I want to say is.

My code compares two values that is network drivers(second xls sheet)
with table1(first xls sheet) then it results in numeric numbers.
Say example particular network driver is cell 1 of network drivers.xls
is used 3 times in table1.So the 3 times is for a particular feature.
So I want it to display the feature name instead of the numeric 3.

Thanks for your help.


On Aug 30, 4:16 pm, Joel wrote:
why not one statement

NetworkDrivers.UsedRange.printout



"tannu" wrote:
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- Hide quoted text -


- Show quoted text -



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default How to print the values of cells

Hi joel

feature names located in first sheet (table1).

Table 1 xls has : first xls
hostname network drivers feature
x e100 install
y tgx upgrade
z e100 install

network drivers (second xls)
network driver Install
e100 2
tgx 1


So instead of "2" I would like the hostnames "x" and "z".

Thanks for help.


On Sep 2, 5:07*am, Joel wrote:
Where is the feature name located?



"tannu" wrote:
Hi Joel
Thank for your reply.
I don't want to print the results ,what I want to say is.


My code compares two values that is network drivers(second xls sheet)
with table1(first xls sheet) then it results in numeric numbers.
Say example particular network driver is cell 1 of network drivers.xls
is used 3 times in table1.So the 3 times is for a particular feature.
So I want it to display the feature name instead of the numeric 3.


Thanks for your help.


On Aug 30, 4:16 pm, Joel wrote:
why not one statement


NetworkDrivers.UsedRange.printout


"tannu" wrote:
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- Hide quoted text -


- Show quoted text -- Hide quoted text -


- Show quoted text -




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default How to print the values of cells



from
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

to
For j = 2 To NetworkDrivers_usedCol
project = UCase(Trim(NetworkDrivers.Cells(1, j)))
MyString = ""
For c = 2 To Table1_usedRow
If UCase(Trim(Table1.Cells(c, 8 )) = drivers Then
If UCase(Trim(Table1.Cells(c, 9))) = project Then
if MyString = "" then
MyString = Table1.Cells(c, 8)
else
MyString = MyString & "," & Table1.Cells(c, 8)
end if
End If
End If
Next c
NetworkDrivers.Cells(i, j) = MyString

"tannu" wrote:

Hi joel

feature names located in first sheet (table1).

Table 1 xls has : first xls
hostname network drivers feature
x e100 install
y tgx upgrade
z e100 install

network drivers (second xls)
network driver Install
e100 2
tgx 1


So instead of "2" I would like the hostnames "x" and "z".

Thanks for help.


On Sep 2, 5:07 am, Joel wrote:
Where is the feature name located?



"tannu" wrote:
Hi Joel
Thank for your reply.
I don't want to print the results ,what I want to say is.


My code compares two values that is network drivers(second xls sheet)
with table1(first xls sheet) then it results in numeric numbers.
Say example particular network driver is cell 1 of network drivers.xls
is used 3 times in table1.So the 3 times is for a particular feature.
So I want it to display the feature name instead of the numeric 3.


Thanks for your help.


On Aug 30, 4:16 pm, Joel wrote:
why not one statement


NetworkDrivers.UsedRange.printout


"tannu" wrote:
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- Hide quoted text -


- Show quoted text -- Hide quoted text -


- Show quoted text -



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
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 07:52 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"