ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   macros (https://www.excelbanter.com/excel-programming/299840-re-macros.html)

steveB

macros
 
Range("A1") = Workbookfunction(VLookUP(Range("A2",Range("M1:P5") ,2))

Just substitute the cell and range settings.
You may want to use

Range("A1").Value=.............

hth
--

steveB

(Remove 'NOSPAM' from email address if contacting me direct)


"hey" wrote in message
...
I would like to see the writing for a macro that looks up a value in a

table then copies it and pastes it to a certain cell.

Thanks




HEY

macros
 
CONFUSING ME NOW. WHAT AM I DOING WITH WHAT YOU WROTE. THANKS

HEY

macros
 
could you write it exactly as i need it, incorporating franks and yours

thanks

Frank Kabel

macros
 
Hi
he just gave you a statement which can be used within a macro. For a
complete example see my post (Logic is very similar)

--
Regards
Frank Kabel
Frankfurt, Germany


HEY wrote:
CONFUSING ME NOW. WHAT AM I DOING WITH WHAT YOU WROTE. THANKS



Frank Kabel

macros
 
Hi Steve
what is 'workbookfunction' :-)
you probably meant
Range("A1").value =
application.VLookUP(Range("A2").value,Range("M1:P5 "),2,0)

(also clearing some typos and adding the 4th parameter to vlookup)


--
Regards
Frank Kabel
Frankfurt, Germany


steveB wrote:
Range("A1") = Workbookfunction(VLookUP(Range("A2",Range("M1:P5") ,2))

Just substitute the cell and range settings.
You may want to use

Range("A1").Value=.............

hth

"hey" wrote in message
...
I would like to see the writing for a macro that looks up a value in
a

table then copies it and pastes it to a certain cell.

Thanks



steveB

macros
 
Frank,

My bad... Meant to use WorksheetFunction.

Have been home to long and the senior moments are piling up...

Thanks for catching this. Don't want to confuse the user anymore than need
be...

--

steveB

(Remove 'NOSPAM' from email address if contacting me direct)


"Frank Kabel" wrote in message
...
Hi Steve
what is 'workbookfunction' :-)
you probably meant
Range("A1").value =
application.VLookUP(Range("A2").value,Range("M1:P5 "),2,0)

(also clearing some typos and adding the 4th parameter to vlookup)


--
Regards
Frank Kabel
Frankfurt, Germany


steveB wrote:
Range("A1") = Workbookfunction(VLookUP(Range("A2",Range("M1:P5") ,2))

Just substitute the cell and range settings.
You may want to use

Range("A1").Value=.............

hth

"hey" wrote in message
...
I would like to see the writing for a macro that looks up a value in
a

table then copies it and pastes it to a certain cell.

Thanks





HEY

macros
 
This works, but it still isnt a cut and paste. Is this possible to incorporate

Thanks


All times are GMT +1. The time now is 02:21 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com