Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
change macro
I want to change this macro so result isn't in listbox but on sheet1
starting with cell E1. Private Sub UserForm_Initialize() Dim cell As Range Dim sh As Worksheet With Me .ListBox1.RowSource = "" .ListBox1.ColumnCount = 3 .ListBox1.Clear End With Set sh = Worksheets("Ark1") For Each cell In sh.Range("A10:A250") If cell.Value = sh.Range("A5").Value Then With UserForm1 .ListBox1.AddItem cell.Value .ListBox1.List(.ListBox1.ListCount - 1, 1) _ = cell.Offset(0, 2).Value .ListBox1.List(.ListBox1.ListCount - 1, 2) _ = cell.Offset(0, 5).Value End With End If Next End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
change macro
Private Sub UserForm_Initialize()
Dim cell As Range Dim sh As Worksheet Dim sh1 As Worksheet Dim i As Long Set sh = Worksheets("Ark1") Set sh1 = Worksheets("Sheet1") i = 1 For Each cell In sh.Range("A10:A250") If cell.Value = sh.Range("A5").Value Then With sh1 .Cells(i,"A").Value = cell.Value .Cells(i,"B").Value = cell.Offset(0, 2).Value .Cells(i,"C").Value = cell.Offset(0, 5).Value i = i + 1 End With End If Next End Sub -- HTH RP (remove nothere from the email address if mailing direct) "Alen32" wrote in message lkaboutsoftware.com... I want to change this macro so result isn't in listbox but on sheet1 starting with cell E1. Private Sub UserForm_Initialize() Dim cell As Range Dim sh As Worksheet With Me .ListBox1.RowSource = "" .ListBox1.ColumnCount = 3 .ListBox1.Clear End With Set sh = Worksheets("Ark1") For Each cell In sh.Range("A10:A250") If cell.Value = sh.Range("A5").Value Then With UserForm1 .ListBox1.AddItem cell.Value .ListBox1.List(.ListBox1.ListCount - 1, 1) _ = cell.Offset(0, 2).Value .ListBox1.List(.ListBox1.ListCount - 1, 2) _ = cell.Offset(0, 5).Value End With End If Next End Sub |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
change macro
Thanks Bob!
What I need to change if I want to display results starting with cell F10. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
change macro
This line
For Each cell In sh.Range("A10:A250") and maybe this line? If cell.Value = sh.Range("A5").Value Then -- HTH Bob Phillips "Alen32" wrote in message lkaboutsoftware.com... Thanks Bob! What I need to change if I want to display results starting with cell F10. |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
change macro
I think you misunderstod me. I want to display results starting with cell
F10. I tried this but doesn't work from .Cells(i,"A").Value = cell.Value to thix .Cells(i,"F10").Value = cell.Value |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
change macro
Private Sub UserForm_Initialize()
Dim cell As Range Dim sh As Worksheet Dim sh1 As Worksheet Dim i As Long Set sh = Worksheets("Ark1") Set sh1 = Worksheets("Sheet1") i = 10 For Each cell In sh.Range("A10:A250") If cell.Value = sh.Range("A5").Value Then With sh1 .Cells(i,"F").Value = cell.Value .Cells(i,"G").Value = cell.Offset(0, 2).Value .Cells(i,"H").Value = cell.Offset(0, 5).Value i = i + 1 End With End If Next End Sub -- HTH RP (remove nothere from the email address if mailing direct) "Alen32" wrote in message lkaboutsoftware.com... I think you misunderstod me. I want to display results starting with cell F10. I tried this but doesn't work from .Cells(i,"A").Value = cell.Value to thix .Cells(i,"F10").Value = cell.Value |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
change macro
Now results are in cell F1,G1 and H1.
I want result in F10,G10 and H10 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Use Macro To Change Which Macro Assigned To Command Button | Excel Discussion (Misc queries) | |||
Insert row at change macro - how to change it. | Excel Discussion (Misc queries) | |||
macro that will change the font of a cell if i change a value | Excel Discussion (Misc queries) | |||
I tried to get around the problem of the pivot table field settingdefaulting to Count instead of Sum by running a macro of change the settingfrom Count to Sum. However, when I tried to run the Macro, I got error messageof run time error 1004, unable | Excel Worksheet Functions | |||
How do I change macro text with another macro? | Excel Discussion (Misc queries) |