cell-defined search

VBnewbie

New Member
Joined
Mar 14, 2002
Messages
1
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!

:oops:What exactly do i have to enter as WHAT: under search command to get the value of the drop-down-fields Target cell?
:oops:And how can i make VB get exactly:oops: 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?
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.

Forum statistics

Threads
1,214,516
Messages
6,119,980
Members
448,934
Latest member
audette89

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top