$$Excel-Macros$$ Re: Excluding holidays from a UDF

2010-10-19 Thread Kishan Reddy, K
A break through

Maintain your holidays in a worksheet.
(either maintain them in ascending order
or order them through code
depending on the frequency of changes in holidays)

In the function just count the holidays falling between start_date and
end_date
simply deduct them from the getworkdays.

Regards,
Kishan Reddy, K


On Oct 18, 5:42 pm, me! infinite.space@googlemail.com wrote:
 Hi,  I have the following code that calculates the number of days
 (excluding Sundays) between two dates, and ideally I'd like to add
 another parameter to my function to allow me to exclude non-working
 days (in a similar way to the in-built NETWORKDAYS function - -
 NETWORKDAYS(start_date,end_date,holidays)

 Can anyone help? . . . Many thanks,  J

 Function GetWorkdays(FirstDate As Date, LastDate As Date, _
 Optional Hols As Variant) As Integer
 Dim i As Integer, ii As Integer, wkdys As Integer
 Dim dy As Date
 Dim f As Boolean

 wkdys = 0
 For i = 1 To (LastDate - FirstDate)
 dy = CDate(FirstDate + i)
 If Weekday(dy)  1 Then
 f = False
 If Not IsMissing(Hols) Then
 For ii = 1 To Hols.Count
 If Len(Hols(ii)) = 0 Then Exit For
 If CDate(Hols(ii)) = dy Then
 f = True
 Exit For
 End If
 Next
 End If
 If Not f Then wkdys = wkdys + 1
 End If
 Next
 GetWorkdays = wkdys
 End Function

-- 
--
Some important links for excel users:
1. Follow us on TWITTER for tips tricks and links : 
http://twitter.com/exceldailytip
2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310
3. Excel tutorials at http://www.excel-macros.blogspot.com
4. Learn VBA Macros at http://www.quickvba.blogspot.com
5. Excel Tips and Tricks at http://exceldailytip.blogspot.com
 
To post to this group, send email to excel-macros@googlegroups.com


Like our page on facebook , Just follow below link
http://www.facebook.com/pages/discussexcelcom/160307843985936?v=wallref=ts


Re: $$Excel-Macros$$ help required

2010-10-19 Thread Chandra Gupta
Hello, Dear

Please check this. Perhaps you need this.

Thanks
Chandra Gupta Maurya

On Mon, Oct 18, 2010 at 7:52 PM, girish kumar
girishkumar832...@gmail.comwrote:

 Dear Experts,

 need one urgent help from you guys i have attached one file having 2 sheets
 named system data  Raw CDR

 i need a formula for getting name in sheet Raw CDR

 for exam

 sheet system data having no

 93  Afghanistan Other

 and Raw Cdr having No

 93854512115
 for getting destination name in sheet raw CDR i m using 1st left function

 like =left(A2,13) and again giving vllokup formula as mentioned in sheet if
 data not found, then i decrease the no's in left function as 12, 11, 10 till
 i get the destintaion name

 problem is data will be very huge and take more time to calculate

 so friends if u can find any logical function for this it'll help me very
 much

 thanks in advance

 Girish

 --

 --
 Some important links for excel users:
 1. Follow us on TWITTER for tips tricks and links :
 http://twitter.com/exceldailytip
 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310
 3. Excel tutorials at http://www.excel-macros.blogspot.com
 4. Learn VBA Macros at http://www.quickvba.blogspot.com
 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com

 To post to this group, send email to excel-macros@googlegroups.com

 
 Like our page on facebook , Just follow below link
 http://www.facebook.com/pages/discussexcelcom/160307843985936?v=wallref=ts


-- 
--
Some important links for excel users:
1. Follow us on TWITTER for tips tricks and links : 
http://twitter.com/exceldailytip
2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310
3. Excel tutorials at http://www.excel-macros.blogspot.com
4. Learn VBA Macros at http://www.quickvba.blogspot.com
5. Excel Tips and Tricks at http://exceldailytip.blogspot.com
 
To post to this group, send email to excel-macros@googlegroups.com


Like our page on facebook , Just follow below link
http://www.facebook.com/pages/discussexcelcom/160307843985936?v=wallref=ts


help Required(2).xlsx
Description: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet


$$Excel-Macros$$ Re: Formula to monitor profit/loss in stocks trading

2010-10-19 Thread Yahya
Dear all

Can someone help me in this or provide a better spreadsheet?




On Mon, Oct 18, 2010 at 8:47 AM, Yahya yahya...@gmail.com wrote:


 Dear all

 I use the attached excel sheet to calculate the profit/loss in the trading
 of individual stocks. The formula works fine in normal cases. But whenever
 there is some bonus/stock split etc. it fails. Can someone help me to derive
 a formula that will suit all cases?

 --



 Regards

 Yahya




-- 



Regards

Yahya

-- 
--
Some important links for excel users:
1. Follow us on TWITTER for tips tricks and links : 
http://twitter.com/exceldailytip
2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310
3. Excel tutorials at http://www.excel-macros.blogspot.com
4. Learn VBA Macros at http://www.quickvba.blogspot.com
5. Excel Tips and Tricks at http://exceldailytip.blogspot.com
 
To post to this group, send email to excel-macros@googlegroups.com


Like our page on facebook , Just follow below link
http://www.facebook.com/pages/discussexcelcom/160307843985936?v=wallref=ts


Re: $$Excel-Macros$$ help required

2010-10-19 Thread Jai
Please check the attachment,














On Tue, Oct 19, 2010 at 10:32 AM, girish kumar
girishkumar832...@gmail.comwrote:

 Hi Krishna,

 see file attached, in that second sheet u see in b column i used Left
 function and in c column Vlookup

 left function i used =left(A2.13)

 and vlookup answer is #N/A

 Because In System Data sheet Left function answer is not there

 if i decrease the no's in left function i ll get the answer

 likewise till i get answer i have to decrease the no in left function

 hope u understand now

 data will be very huge and it take long time to vlookup calculate

 so try to give any logical function.

 Thanks in advance

 Girish

 On Mon, Oct 18, 2010 at 9:18 PM, krishna mummina 
 lovemekris...@gmail.comwrote:

 Dear Girish,

 Sorry I didn't understand what you are looking for,

 Please give an Example, what you want exactly?

 May be i have some communication problem to understand your query.

 Thanks,
 Excelkid

   On Mon, Oct 18, 2010 at 7:52 PM, girish kumar 
 girishkumar832...@gmail.com wrote:

  Dear Experts,

 need one urgent help from you guys i have attached one file having 2
 sheets named system data  Raw CDR

 i need a formula for getting name in sheet Raw CDR

 for exam

 sheet system data having no

 93  Afghanistan Other

 and Raw Cdr having No

93854512115
  for getting destination name in sheet raw CDR i m using 1st left
 function

 like =left(A2,13) and again giving vllokup formula as mentioned in sheet
 if data not found, then i decrease the no's in left function as 12, 11, 10
 till i get the destintaion name

 problem is data will be very huge and take more time to calculate

 so friends if u can find any logical function for this it'll help me very
 much

 thanks in advance

 Girish

 --

 --
 Some important links for excel users:
 1. Follow us on TWITTER for tips tricks and links :
 http://twitter.com/exceldailytip
 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310
 3. Excel tutorials at http://www.excel-macros.blogspot.com
 4. Learn VBA Macros at http://www.quickvba.blogspot.com
 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com

 To post to this group, send email to excel-macros@googlegroups.com

 
 Like our page on facebook , Just follow below link

 http://www.facebook.com/pages/discussexcelcom/160307843985936?v=wallref=ts


 --

 --
 Some important links for excel users:
 1. Follow us on TWITTER for tips tricks and links :
 http://twitter.com/exceldailytip
 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310
 3. Excel tutorials at http://www.excel-macros.blogspot.com
 4. Learn VBA Macros at http://www.quickvba.blogspot.com
 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com

 To post to this group, send email to excel-macros@googlegroups.com

 
 Like our page on facebook , Just follow below link

 http://www.facebook.com/pages/discussexcelcom/160307843985936?v=wallref=ts


 --

 --
 Some important links for excel users:
 1. Follow us on TWITTER for tips tricks and links :
 http://twitter.com/exceldailytip
 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310
 3. Excel tutorials at http://www.excel-macros.blogspot.com
 4. Learn VBA Macros at http://www.quickvba.blogspot.com
 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com

 To post to this group, send email to excel-macros@googlegroups.com

 
 Like our page on facebook , Just follow below link
 http://www.facebook.com/pages/discussexcelcom/160307843985936?v=wallref=ts




-- 
Thanks For Mail.

-- 
--
Some important links for excel users:
1. Follow us on TWITTER for tips tricks and links : 
http://twitter.com/exceldailytip
2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310
3. Excel tutorials at http://www.excel-macros.blogspot.com
4. Learn VBA Macros at http://www.quickvba.blogspot.com
5. Excel Tips and Tricks at http://exceldailytip.blogspot.com
 
To post to this group, send email to excel-macros@googlegroups.com


Like our page on facebook , Just follow below link
http://www.facebook.com/pages/discussexcelcom/160307843985936?v=wallref=ts


help_Required.xlsx
Description: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet


Re: $$Excel-Macros$$ help required

2010-10-19 Thread girish kumar
hi experts,

its a rolling up method

for example

if raw cdr having No 93854512115
then formula should find name for this no if didnt then
it roll up one no and then find again (like 9385451211)
till finding name it will rolling up

hope now u understand

Girish


On Tue, Oct 19, 2010 at 1:24 PM, Jai jaihumtu...@gmail.com wrote:

 Please check the attachment,














 On Tue, Oct 19, 2010 at 10:32 AM, girish kumar 
 girishkumar832...@gmail.com wrote:

 Hi Krishna,

 see file attached, in that second sheet u see in b column i used Left
 function and in c column Vlookup

 left function i used =left(A2.13)

 and vlookup answer is #N/A

 Because In System Data sheet Left function answer is not there

 if i decrease the no's in left function i ll get the answer

 likewise till i get answer i have to decrease the no in left function

 hope u understand now

 data will be very huge and it take long time to vlookup calculate

 so try to give any logical function.

 Thanks in advance

 Girish

 On Mon, Oct 18, 2010 at 9:18 PM, krishna mummina lovemekris...@gmail.com
  wrote:

 Dear Girish,

 Sorry I didn't understand what you are looking for,

 Please give an Example, what you want exactly?

 May be i have some communication problem to understand your query.

 Thanks,
 Excelkid

   On Mon, Oct 18, 2010 at 7:52 PM, girish kumar 
 girishkumar832...@gmail.com wrote:

  Dear Experts,

 need one urgent help from you guys i have attached one file having 2
 sheets named system data  Raw CDR

 i need a formula for getting name in sheet Raw CDR

 for exam

 sheet system data having no

 93  Afghanistan Other

 and Raw Cdr having No

93854512115
  for getting destination name in sheet raw CDR i m using 1st left
 function

 like =left(A2,13) and again giving vllokup formula as mentioned in sheet
 if data not found, then i decrease the no's in left function as 12, 11, 10
 till i get the destintaion name

 problem is data will be very huge and take more time to calculate

 so friends if u can find any logical function for this it'll help me
 very much

 thanks in advance

 Girish

 --

 --
 Some important links for excel users:
 1. Follow us on TWITTER for tips tricks and links :
 http://twitter.com/exceldailytip
 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310
 3. Excel tutorials at http://www.excel-macros.blogspot.com
 4. Learn VBA Macros at http://www.quickvba.blogspot.com
 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com

 To post to this group, send email to excel-macros@googlegroups.com

 
 Like our page on facebook , Just follow below link

 http://www.facebook.com/pages/discussexcelcom/160307843985936?v=wallref=ts


 --

 --
 Some important links for excel users:
 1. Follow us on TWITTER for tips tricks and links :
 http://twitter.com/exceldailytip
 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310
 3. Excel tutorials at http://www.excel-macros.blogspot.com
 4. Learn VBA Macros at http://www.quickvba.blogspot.com
 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com

 To post to this group, send email to excel-macros@googlegroups.com

 
 Like our page on facebook , Just follow below link

 http://www.facebook.com/pages/discussexcelcom/160307843985936?v=wallref=ts


 --

 --
 Some important links for excel users:
 1. Follow us on TWITTER for tips tricks and links :
 http://twitter.com/exceldailytip
 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310
 3. Excel tutorials at http://www.excel-macros.blogspot.com
 4. Learn VBA Macros at http://www.quickvba.blogspot.com
 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com

 To post to this group, send email to excel-macros@googlegroups.com

 
 Like our page on facebook , Just follow below link

 http://www.facebook.com/pages/discussexcelcom/160307843985936?v=wallref=ts




 --
 Thanks For Mail.

  --

 --
 Some important links for excel users:
 1. Follow us on TWITTER for tips tricks and links :
 http://twitter.com/exceldailytip
 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310
 3. Excel tutorials at http://www.excel-macros.blogspot.com
 4. Learn VBA Macros at http://www.quickvba.blogspot.com
 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com

 To post to this group, send email to excel-macros@googlegroups.com

 
 Like our page on facebook , Just follow below link
 http://www.facebook.com/pages/discussexcelcom/160307843985936?v=wallref=ts


-- 
--
Some important links for excel users:
1. Follow us on TWITTER for tips tricks and links : 

$$Excel-Macros$$ Dynamically assign values to an array using ComboBoxes

2010-10-19 Thread RemyMaza
I have a form with 7 combo boxes on it and I'd like to take the values
from the selections and store the value into an array.  Some
background:  The first two combo boxes must be selected otherwise the
form should not do anything.  As long as the first two equal a value,
the rest of them *could* be blank or contain a value.  What I'd like
to do is grab all of the values that aren't blank and resize my array
with these values.  I'm a bit green with arrays, so a layman's
approach would go a long way.  Here's the code I have already:

Dim cCont As Control
Dim arrDeviceVal() As String
Dim i As Integer

i = 0

'I'm stuck on the logic for this array
'Finds vals for Devices and ReDim's the array
For Each cCont In Me.Controls
If TypeName(cCont) = ComboBox Then
arrDeviceVal = 
   'Also when I type: cCont. I do not get a property of Value
as I would expect.  How am I to get the value of the combo box then?
End If
Next cCont

For i = 0 To UBound(arrDeviceVal)
MsgBox arrDeviceVal(i)
Next i
If cmb1.Value =  Or cmb2.Value =  Then
MsgBox Device 1 and Device 2 cannot be blank.  Choose a
device for both of these to continue., vbCritical
Else
'ActiveWorkbook.Sheets(ALL FILE).Range(C  (intCellRow -
8)).Value = arrDeviceVal(0)
Unload Me
End If



Thanks for any insight!!!
Cheers,
Matt

-- 
--
Some important links for excel users:
1. Follow us on TWITTER for tips tricks and links : 
http://twitter.com/exceldailytip
2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310
3. Excel tutorials at http://www.excel-macros.blogspot.com
4. Learn VBA Macros at http://www.quickvba.blogspot.com
5. Excel Tips and Tricks at http://exceldailytip.blogspot.com
 
To post to this group, send email to excel-macros@googlegroups.com


Like our page on facebook , Just follow below link
http://www.facebook.com/pages/discussexcelcom/160307843985936?v=wallref=ts


$$Excel-Macros$$ Help with DoEvents to show progress form, please?

2010-10-19 Thread Ed from AZ
I've got a pretty long-running macro inside a UserForm, and I wanted
to open a second form just to show that things are still working and
not crashed.  It's pretty simple - four labels and I cycle around
turning one at a time a different color.

I call it from the main form with
Private Sub CommandButton1_Click()

DoEvents
frmWaiting.Show vbModeless
DoEvents

Unfortunately, once the code drops into the second form, the main
code
in the first form never executes.

I thought DoEvents was supposed to let the running code drop
through
to allow both forms to run their code.  Obviously, I'm very
incorrect!!  8(

How can I make this happen correctly?
Ed
(XL2007, Vista Pro)

-- 
--
Some important links for excel users:
1. Follow us on TWITTER for tips tricks and links : 
http://twitter.com/exceldailytip
2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310
3. Excel tutorials at http://www.excel-macros.blogspot.com
4. Learn VBA Macros at http://www.quickvba.blogspot.com
5. Excel Tips and Tricks at http://exceldailytip.blogspot.com
 
To post to this group, send email to excel-macros@googlegroups.com


Like our page on facebook , Just follow below link
http://www.facebook.com/pages/discussexcelcom/160307843985936?v=wallref=ts