Avg # Attempts Before Failure

Mar 25, 2009

Trying to calculate average successful attempts before failure. Have several hundred data points (1=success, 0=failure). A1:A10 = 1 1 1 1 1 0 1 1 1 0

Cell A11 should calculate average attempts between failures for the whole range A1:A10.

View 6 Replies


ADVERTISEMENT

Delete Workbook After 3 Attempts

Jan 24, 2008

Now that the code is configured to do what I want, can someone assist me in adding a code that will delete the expired file after the third attempt of the user trying to open an expired file.

Private Sub Workbook_Open()
Dim StartTime#, CurrentTime#

Const TrialPeriod# = 1 '< 1 days trial

Const ObscurePath$ = "C:"
Const ObscureFile$ = "LBFileLog.Log"
'*****************************************

If Dir(ObscurePath & ObscureFile) = Empty Then
StartTime = Format(Now, "#0.#########0")
Open ObscurePath & ObscureFile For Output As #1
Print #1, StartTime....................................

View 10 Replies View Related

Limit Password Attempts

Jan 25, 2008

I have a code the requires user to enter a password when prompted, but i like to limit the user from attempting to enter a password to "x" amount of times.

View 10 Replies View Related

Password: Count Attempts

Nov 19, 2006

I notice i could not get into the Vb script password for the excel file given by royUk. May i know what's the password to open it? I need to see it urgently as i am rushing for my current project.

View 5 Replies View Related

Limit User Name & Password Verification Attempts

Mar 5, 2008

I'm trying to write what is supposed to be a simple script that looks at a column of usernames (ColumnA) and passwords (ColumnB). I start off by prompting the user to enter their username in an input box and then I want a loop to check this value against the values in Column A. If the username exists, I want to prompt an input box for the password. If the username does not exist I need some kind of limit on the loop to prompt an input box for the user to enter a new username and password that I'll add to the last row of the data table. The loop part is kicking my butt, this is what I have so far...

Sub Main()
Set StartRange = Worksheets("16.10"). Range("A1")
username = InputBox("Please enter your username.", "Enter username", "Jdoe")
i = 1
Do While StartRange.Offset(i, 0).Value <> "username"
i = i + 1
Loop
If StartRange.Offset(i, 0).Value = "username" Then
password = InputBox("Please enter your password.", "Enter password", "password")
End If
End Sub

View 7 Replies View Related

Calculate Players Ranking Based On Their Weight Categories And Attempts Total?

Jan 31, 2014

I am trying to calculate players ranking based on their weight categories and attempts total, e.g. Category (50kg, 69kg etc..) Rank should be calculated automatically the highest total value of cat. 50kg is 1st second highest is 2nd etc. However, if tow players or more within the same Category have scored same point ranking will be calculated based on Body Weight less comes first and if both have similar weight calculation will be based on Start # first player comes first etc..

Table:
Start #
Name
Body Weight
Team
Category
Total Point
Rank

1
Player #1
49.2
Team #1
50kg
75

View 2 Replies View Related

Do...Loop Failure!

Nov 5, 2008

Do...Loop failure!
I thought I was being smart and have produced the following

View 2 Replies View Related

=SUMPRODUCT Formula Failure

Feb 24, 2009

No doubt due to a fundamental lack of understanding my SUMPRODUCT formulae (please see attached workbook) is not working.

Can someone be kind enough to point out the error of my ways? I've tried every possible combination (except the right one).

View 7 Replies View Related

Worksheet.Opentext Failure?

Jan 7, 2009

I am struggling with the Worksheet.Opentext code required to open a text file in excel - specifically with the date format.

For example, I have a text file containing Feb08.

When opened manually using space as deliminator it correctly returns 01/02/2008.

However, when I record the same opening action as a macro and then run same macro it returns 08/02/2009, which is incorrect. Try it and see for yourself!

View 7 Replies View Related

Userform Sub Reference Failure

Jul 16, 2009

I have a program that creates a userform, but it cannot complete the initialization. The initializer calls the sub below, supplying the relevant worksheet, category header, and combobox tag for the form. So far, it will find the header of interest on the worksheet. I want it to load all the cell data in the target header column into the form's combobox. The sub, however, has an issue with the line highlighted in red. I think it has to do with the way the combobox tag is referenced in the line, but I don't know how to fix it.

View 9 Replies View Related

Dynamic Chart Failure

Jun 6, 2008

1. I'm using Excel 2007

2. I'm trying to create a dynamic chart - following instructions from the numerous other threads on the topic

3. When I try to use a dynamic named range in the "Select Data Source" box, it creates a fatal error and the program shuts down.

View 9 Replies View Related

Sort Failure On First Attempt Only

Feb 23, 2007

My file has 8 sheets with identical linked drop-down boxes at the top. Sheet1 has a graph that needs to be sorted from top to bottom each time a drop-down box from any of the sheets is adjusted. Using tips from this site, my macro moves to Sheet1, sorts, and then returns to whichever sheet I start at.

This works if the first drop-down box I adjust is from Sheet1. If the first drop-down box I adjust is from any other sheet I get "Run-time error '1004': Sort Method of Range Class Failed." Basically I get an error unless I use a Sheet1 drop-down box first. After using a Sheet1 drop-down box, all sheets work without error. How can I fix this error? Below is my macro................

View 4 Replies View Related

Write Text To Cell - Failure

Oct 5, 2008

I have just started VBA for the first time in Excel 2007. I have spent 2-3 hours trying to write text to a cell and I do not understand why it is not working. I have reduced the operation to the simplest form that I can find, now using the following

View 3 Replies View Related

ComboBox Select Failure, And RowSourse

Apr 18, 2009

In applications I make in Excel I often make use of ComboBoxes to select a unique value.

Prior to Excel-2007 this was a complicated and time consuming loop construction that had problems with larger files. So I was happy to find the “Remove Duplicates” function in Excel-2007 and tried to use that.

Process:

- Select column of data. (In my example column F)
- Copy to other sheet (DROP LISTS)
- Apply Remove Duplicates function.
- Sort alphabetically.
- Establish length of list.
- Set that range as Row Source of the ComboBox.

So far so good but there are three problems: ...

View 9 Replies View Related

VBA Dynamic Range Selection Failure

Aug 3, 2009

I have a log that I use to keep track of my hours where the days hours and charge numbers get summed and moved to a new sheet via a command button. One of the categories is week ending date. I want the week ending date cells to merge if they match and cannot get the range I want to highlight. I can move the data, find and define the first and last cells in the range, but can't get the range.select command to work. I think it is just a syntax error, as I am new to VBA.

I can open a Locals window and watch it assign values to myFirstCell and myLastCell of "$A$36" and "$A$44" respectively, but I get an error on either the set range= or range.select lines.

My code is as follows:

Private Sub Post_Hours_To_Log_Click()
'Posts the day's hours to the hours tracker.

Dim myFirstCell, myLastCell As Variant

Dim myRange As Variant

***Removed N/A code that goes to another sheet and decides which data to copy***
Application.Goto reference:=Worksheets("Hours Log").Range("A2"), _
Scroll:=False

View 9 Replies View Related

Rounding Result Causes VLOOKUP Failure

Jan 25, 2007

Round Result Used As Vlookup Lookup_value Does Work For 6% in attached spreadsheet. I am an experienced user of Excel and have never come across something I could not solve before but this has stumped me. The issue is now sorted using different formulas but I do not know why the attached has #N/A errors in the Yellow highlighted cells.

View 4 Replies View Related

Sort Failure In Code: Run-time Error '1004'

May 9, 2008

This piece of code runs perfectly on its own but when called at the end of another code it fails and I haven't a clue why. The reference wsTmp is dim'd globally and defined in the main component where it is simply - worksheets("somename")

Run-time error '1004':

The sort reference is not valid. Make sure that it's within the data you want to sort, and the first Sort By box isn't the same or blank.

Private Sub FinalSort()

wsTmp.Cells.Sort Key1:=Range("D2"), Order1:=xlAscending, Key2:=Range("A2") _
, Order2:=xlAscending, Key3:=Range("K2"), Order3:=xlAscending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal, DataOption2:=xlSortNormal, DataOption3:= _
xlSortNormal
End Sub

View 9 Replies View Related

Failure Of Automatic Calculation When Worksheet Moved To Another File

Jun 1, 2008

I have workbooks in which summary tables are generated by lookup formulas. Tables are on different sheets but all use the same lookup value by referring to a cell on the 'master' sheet. The lookup value appears in cells on all sheets, by reference to the master sheet (e.g. [formula] = mastersheet!$B$2).

The master sheet contains the main summary table and is copied and detached for distribution, using a macro. For practical reasons, this is done in two stages, first copying the sheet within the workbook (to make minor alterations), then moving it to a new book to save and distribute.

This is where the problem arises. After the sheet has been detached, we find that if we now change the lookup value on the master sheet in the original file, the tables on that sheet will update normally, but the cells on other sheets remain frozen at the previous value and the tables on those sheets do not update.

The only way round the problem is by Shift + Ctrl + Alt + F9. (Maybe I should add that all my workbooks are always set to automatic calculation.)

The macro itself is not the cause of the problem; if we follow the same procedure manually, the result is the same. However, if we move the sheet in one step, eliminating the intermediate copying stage, the problem does not arise. But this is evading the problem, not solving it, and I would be reluctant to have to resort to this.

The original problem remains as stated, viz. failure of automatic calculation.

View 5 Replies View Related

Excel 2010 :: Macro To Send Email Now Fails With Runtime Error 1004 - Mail System Failure

Aug 23, 2012

I've been using a macro successfully for the last couple of years, but this morning when I went to use it, it decided to fail. I have a workbook which contains various spreadsheets. The macro that has failed performs the following tasks:

1. It copies a list of email addresss from an external workbook to a sheet in the current workbook (still works)
2. It copies the referral sheet I want to send to a new file, and saves it with an appropriate filename to an appropriate folder (still works)
3. The macro then creates an email with a standard subject line, attaches the new worksheet and emails it to each of the addresses as above (broken)

The error message is from Microsoft Visual Basic. "Run-time error '1004': Mail system failure. Check your mail installation."

I'm guessing there is a setting somewhere in Excel that has changed as part of an update.

I've been through a number of the options in the developer menu to remove any obvious restrictions (& reopened excel afterwards), but so far it hasn't resolved the problem.

For what it's worth, here is the macro code.

With Application
.EnableEvents = False
.ScreenUpdating = False
End With
Run "PullInSheet1"
Dim oldbook As String

[Code] .......

In case you're wondering about the pullinsheet code, I'll add it below - but I probably grabbed it from this forum a couple of years ago (like some of the above) & just made some changes.

Code:
Sub PullInSheet1()
Dim AreaAddress As String
'''''' Sheet11.UsedRange.Clear
Dim ClRange As String
ClRange = "= 'L:ADMINEMPLOY SERVICES" _

[Code] ........

There are a couple of things I've wanted to do to improve the macro, but I couldn't justify the need to spend time working it out (since writing spreadsheets isn't really my job). Since it's broken at the moment, I can...

1. I'd like to create a subject line that reflects the name of the person being referred. For some reason though, anything other than text in the cell reference caused an error for me. eg, I tried using concatenate to create my subject line, but it didn't work.

2. I'd like the copied sheet to contain all of the formatting of the original sheet. Presumably there is a paste option that will do this and I just picked the wrong one.

The mailsystem we use is Groupwise 8. I couldn't find any settings in that program that have been changed, or that I could change.

I should change the extension from xls to xlsx in the code since I'm using Excel 2010 (but changing it doesn't fix the problem).

View 4 Replies View Related

Filter>Advanced Filter>Unique Failure

Jun 14, 2009

Can anyone explain why the unique filter does not produce a unique result - sample attached?

View 2 Replies View Related

'Select Method' Failure 'error 1004 Select Method Of Range Class Failed'

Oct 28, 2008

My workbook holds a month template and sheets for each month. I work on modifications in the template ,but would then like to update all the monthly worksheets. I recorded a macro to show me how to start programming the vb sub, but get a runtime failure 'error 1004 Select method of range class failed' when trying to select the column to copy,

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved