ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to print the values of cells (https://www.excelbanter.com/excel-programming/416312-how-print-values-cells.html)

tannu

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


joel

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



tannu

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 -



joel

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 -




tannu

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 -



joel

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 -




tannu

How to print the values of cells
 
Hi Joel

Thaks for your reply.
After the change I am getting "e100 e100" unlike earlier I was getting
numeric "2" .
I would like to have the corresponding hostnames "x" and "z" instead
of "e100 e100".

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 e100 e100 (I would like to have "x" and "y")
tgx tgx (I would like to have "z")


Appreciate your help.

Thanks again

On Sep 2, 11:20*am, Joel wrote:
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 -- Hide quoted text -


- Show quoted text -



joel

How to print the values of cells
 
If host name is over one column from networkdriver then

from
if MyString = "" then
MyString = Table1.Cells(c, 8)
else
MyString = MyString & "," & Table1.Cells(c, 8)
end if

to

if MyString = "" then
MyString = Table1.Cells(c, 7)
else
MyString = MyString & "," & Table1.Cells(c, 7)
end if



I changed the 8 to a 7.
"tannu" wrote:

Hi Joel

Thaks for your reply.
After the change I am getting "e100 e100" unlike earlier I was getting
numeric "2" .
I would like to have the corresponding hostnames "x" and "z" instead
of "e100 e100".

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 e100 e100 (I would like to have "x" and "y")
tgx tgx (I would like to have "z")


Appreciate your help.

Thanks again

On Sep 2, 11:20 am, Joel wrote:
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 -- Hide quoted text -


- Show quoted text -




tannu

How to print the values of cells
 
Thanks a million.

It worked and really appreciate your help.

Thanks again.



On Sep 4, 12:03*pm, Joel wrote:
If host name is over one column from networkdriver then

from
* if MyString = "" then
* * * MyString = Table1.Cells(c, 8)
* *else
* * * MyString = MyString & "," & Table1.Cells(c, 8)
* *end if

to

* if MyString = "" then
* * * MyString = Table1.Cells(c, 7)
* *else
* * * MyString = MyString & "," & Table1.Cells(c, 7)
* *end if

I changed the 8 to a 7.



"tannu" wrote:
Hi Joel


Thaks for your reply.
After the change I am getting "e100 e100" unlike earlier I was getting
numeric "2" .
I would like to have the corresponding hostnames "x" and "z" instead
of "e100 e100".


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 * * * * * * * * * * e100 e100 *(I would like to have "x" and "y")
tgx * * * * * * * * * * * tgx * * * * * * (I would like to have "z")


Appreciate your help.


Thanks again


On Sep 2, 11:20 am, Joel wrote:
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 -- Hide quoted text -


- Show quoted text -- Hide quoted text -


- Show quoted text -




All times are GMT +1. The time now is 06:14 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com