Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Print worksheet but dont want two cells too print is it possible | Excel Programming | |||
Only print cells with values | Excel Programming | |||
Print only cells with values | Excel Worksheet Functions | |||
How can I print current row in same place on paper but not print surrounding cells??? | New Users to Excel | |||
print view & print, in excel, different size cells | Excel Discussion (Misc queries) |