Hi! i'm absolutely new to VB, but trying to write some script that:
finds a dropdownfield defined code in a column (the dropdown field has a targetcell in which a numbervalue between 1 and 8 is presented according to selection).
There is a List in which several selections are pssible. The original (search)list is vertical, but I need a horizontal (result)listing for automating a graphical presentation.
The problem is: it doesnt seem to work correctly!
What exactly do i have to enter as WHAT: under search command to get the value of the drop-down-fields Target cell?
And how can i make VB get exactly the cells in which the corresponding values are in (first -> copy whats some cells; second -> copy some cells;...)???
(cause stupid excel always seems to stop a cell above the cell i am looking for.. )
my current NON-working experiment is:
' definition of Target cells for Paste
ZielZ = 12
ZielS = 17
'starting search in column "I" for Value defined in cell "C6"
Columns("I:I").Select
Selection.Find(What:=Range("C6"), After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False).Activate
:->'only in copies for finding further cases of corresponding search-Value; one findnext for each.
:-> Selection.FindNext(After:=ActiveCell).Activate
'definition of active cell
z = ActiveCell.Row
s = ActiveCell.Column
'selection of cells to copy and copy
Range(Cells(z, s - 2), Cells(z + 2, s - 2)).Select
Selection.Copy
'selection of target-cells and paste
Range(Cells(ZielZ + 1, ZielS + 1), Cells(ZielZ + 3, ZielS + 1)).Select
ActiveSheet.Paste
of course i must have made a lot of mistakes, but since i have had no experience in VB (or programming anyway) before monday 'xcept
10 write "hello"
20 goto 10
i guess i've come quite far... :wink:
anyone can help me, plz?
finds a dropdownfield defined code in a column (the dropdown field has a targetcell in which a numbervalue between 1 and 8 is presented according to selection).
There is a List in which several selections are pssible. The original (search)list is vertical, but I need a horizontal (result)listing for automating a graphical presentation.
The problem is: it doesnt seem to work correctly!
What exactly do i have to enter as WHAT: under search command to get the value of the drop-down-fields Target cell?
And how can i make VB get exactly the cells in which the corresponding values are in (first -> copy whats some cells; second -> copy some cells;...)???
(cause stupid excel always seems to stop a cell above the cell i am looking for.. )
my current NON-working experiment is:
' definition of Target cells for Paste
ZielZ = 12
ZielS = 17
'starting search in column "I" for Value defined in cell "C6"
Columns("I:I").Select
Selection.Find(What:=Range("C6"), After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False).Activate
:->'only in copies for finding further cases of corresponding search-Value; one findnext for each.
:-> Selection.FindNext(After:=ActiveCell).Activate
'definition of active cell
z = ActiveCell.Row
s = ActiveCell.Column
'selection of cells to copy and copy
Range(Cells(z, s - 2), Cells(z + 2, s - 2)).Select
Selection.Copy
'selection of target-cells and paste
Range(Cells(ZielZ + 1, ZielS + 1), Cells(ZielZ + 3, ZielS + 1)).Select
ActiveSheet.Paste
of course i must have made a lot of mistakes, but since i have had no experience in VB (or programming anyway) before monday 'xcept
10 write "hello"
20 goto 10
i guess i've come quite far... :wink:
anyone can help me, plz?