Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Two parts of the same thing
Hi,
Within a piece of VBA under Office 2007 on Vista: 1) What is the syntax to use the VlookUp function from within VBA (I want to run a macro that looks does a VlookUp and returns the value to the code - I do not want to embed formulae within the spreadsheet)? 2) I want to copy the contents of a cell on one page to cells on two other pages. Is it possible to do this with one command or do I have to copy-change page-paste-change back-copy-change to 2nd page-paste- change back? TIA Dave |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Two parts of the same thing
Hi Dave
To use a worksheet function in vba use this syntax: Application.WorksheetFunction.Vlookup(.... To copy the value of a cell to several worksheets you can do this. ValueToCopy=Workdsheets("Sheet1").Range("A1").valu e Worksheets("Sheet2").range("A1")=ValueToCopy Hopes it helps Regards, Per "Risky Dave" skrev i meddelelsen ... Hi, Within a piece of VBA under Office 2007 on Vista: 1) What is the syntax to use the VlookUp function from within VBA (I want to run a macro that looks does a VlookUp and returns the value to the code - I do not want to embed formulae within the spreadsheet)? 2) I want to copy the contents of a cell on one page to cells on two other pages. Is it possible to do this with one command or do I have to copy-change page-paste-change back-copy-change to 2nd page-paste- change back? TIA Dave |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Two parts of the same thing
Hi.
Q1 lookupval = Range("C1") lookuparray = Range("A1:B10") myvalue = Application.WorksheetFunction.VLookup(lookupval, lookuparray, 2, False) Q2 It can be done with changin sheets Sheets("sheet2").Range("A1").Value = Sheets("Sheet1").Range("A1").Value Sheets("sheet2").Range("B1").Value = Sheets("Sheet1").Range("A1").Value Mike "Risky Dave" wrote: Hi, Within a piece of VBA under Office 2007 on Vista: 1) What is the syntax to use the VlookUp function from within VBA (I want to run a macro that looks does a VlookUp and returns the value to the code - I do not want to embed formulae within the spreadsheet)? 2) I want to copy the contents of a cell on one page to cells on two other pages. Is it possible to do this with one command or do I have to copy-change page-paste-change back-copy-change to 2nd page-paste- change back? TIA Dave |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Two parts of the same thing
Please post in ONE group ONLY. See your other post in .excel -- Don Guillett Microsoft MVP Excel SalesAid Software "Risky Dave" wrote in message ... Hi, Within a piece of VBA under Office 2007 on Vista: 1) What is the syntax to use the VlookUp function from within VBA (I want to run a macro that looks does a VlookUp and returns the value to the code - I do not want to embed formulae within the spreadsheet)? 2) I want to copy the contents of a cell on one page to cells on two other pages. Is it possible to do this with one command or do I have to copy-change page-paste-change back-copy-change to 2nd page-paste- change back? TIA Dave |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Two parts of the same thing
Don,
Thanks for your reply - please see my follow-up posting 4 minutes after I realised I had posted to the wrong group and 30 minutes before your reply. Dave "Don Guillett" wrote: Please post in ONE group ONLY. See your other post in .excel -- Don Guillett Microsoft MVP Excel SalesAid Software "Risky Dave" wrote in message ... Hi, Within a piece of VBA under Office 2007 on Vista: 1) What is the syntax to use the VlookUp function from within VBA (I want to run a macro that looks does a VlookUp and returns the value to the code - I do not want to embed formulae within the spreadsheet)? 2) I want to copy the contents of a cell on one page to cells on two other pages. Is it possible to do this with one command or do I have to copy-change page-paste-change back-copy-change to 2nd page-paste- change back? TIA Dave |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
not sure if i'm using the right thing | Excel Worksheet Functions | |||
Need one more thing | Excel Programming | |||
One Last Thing | Excel Discussion (Misc queries) | |||
Is there such a thing... | Excel Discussion (Misc queries) | |||
one more thing | Excel Worksheet Functions |