Friday, 15 February 2013

excel - How to second stored variable in a second sheet in VBA -



excel - How to second stored variable in a second sheet in VBA -

i'm trying find variable aa in log using range. find function in excel vba. variable aa declared , classified via range.find function run first. reason, i'm able find variable aa , store value (i've checked) when goes variable in log, doesn't work though exists in other sheet. ideas? below relevant code:

thanks!

sub find_values() ' declare strings variants lookup dim string, b string, c string, d string, e string, f string, g string dim h string, string, j string, k string, l string, m string, n string` ' declare integers variants lookup in sheet1 dim aa double, bb double, cc double, dd double, ee double, ff double, gg double dim hh double, ii double, jj double, kk double, ll double, mm double, nn double = "3001540001" sheets("data").range("a1:l1000") set rng = .find(what:=a, _ after:=.cells(.cells.count), _ lookin:=xlvalues, _ lookat:=xlwhole, _ searchorder:=xlbyrows, _ searchdirection:=xlnext, _ matchcase:=false) if not rng nil application.goto rng, true end if end activecell.offset(0, 4).activate aa = activecell.value worksheets("log").range("a1:z1000") set rng = .find(what:=aa, _ after:=.cells(.cells.count), _ lookin:=xlvalues, _ lookat:=xlwhole, _ searchorder:=xlbyrows, _ searchdirection:=xlnext, _ matchcase:=true, _ searchformat:=false) if not rng nil application.goto rng, true end if end end sub

excel vba excel-vba

No comments:

Post a Comment