SUM/VLOOKUP

S

sonto

Hi,
1, Am using this formula =IF(COUNTIF(A1:A$7,A1)>1,"X","") to sum the
frequency of a staff Identificaton number in terms of
attendance,absentism,number of sick leave days etc how can I get it formula
to sum the frequency?.CAN IT BE DONE IN VBA IF POSSIBLE?
2,I am new to VBA macros and a trying to write a cord for this formula
=VLOOKUP(A1,Sheet1!A:H,3,FALSE) and would like the cord to execute from a
command button on a user form.and the userform should be called when you use
keyboard combination shortcut.eg(contl+A).
<PLS HELP BIG TIME CONFUSED.>
 
S

Simon Lloyd

You didnt say whether you want code to paste the function or not so yo
could use
Code
-------------------
Dim MyFun
MyFunc = Application.WorksheetFunction.VLookup(Range("A1"), Sheets("Sheet1").Range("A:H"), 3, False
MsgBox MyFun
-------------------
sonto;196601 said:
Hi

1, Am using this formula =IF(COUNTIF(A1:A$7,A1)>1,"X","") to sum th
frequency of a staff Identificaton number in terms o
attendance,absentism,number of sick leave days etc how can I get i
formul
to sum the frequency? CAN IT BE DONE IN VBA IF POSSIBLE

2,I am new to VBA macros and a trying to write code for this formul
=VLOOKUP(A1,Sheet1!A:H,3,FALSE) and would like the cord to execute fro

command button on a user form.and the userform should be called whe
you us
keyboard combination shortcut e.g. (CTRL+A)

<PLS HELP BIG TIME CONFUSED.

--
Simon Lloy

Regards,
Simon Lloyd
'The Code Cage' (http://www.thecodecage.com
 
D

Danny Boy

I'd be tempted to investigate use of the FREQUENCY FUNCTION. This is an
array function so takes a little getting used to. Check out the WORKSHEET
FUNCTION news group...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top