Excel 2010 :: Adding Randomly Generated Value To Range?

Apr 7, 2014

Not sure if there is a way to do this. I'm using excel 2010. I used this function

=INDEX(Sheet5!A1:A149,RANDBETWEEN(1,ROWS(Sheet5!A1:A149)))

I have a list on names that is in the range on Sheet5!A1:A149 I'm using the function to randomly select one of those names.

What I want to do: I want to add the randomly generated name to a range that I can then refer to later to see if that name has already come up. So I know if that name has already been used.

View 3 Replies


ADVERTISEMENT

Randomly Generated Number Focusing On Range

Jul 30, 2012

What I need to accomplish here is to randomly (or at least seemingly enough) generate a number between A and B values for many cells.

I know i can accomplish this through =Rand()*(B-A)+A

However lets say that the lower limit is 96 and the upper is 100. How would i get my data spread to appear to center more around 98-99, with a few randomly placed a little farther out but still within 96-100? I'll say i have 500 instances of this generated number. So what i need is the appearance that most of the numbers lie within the inner range with some anomalies outside that but still within the greater range, having fewer and fewer instances as the value gets closer to the outer limits.

I'm also placing this value in cells using VBA (most likely "for each cell in range(xxx)...")

How would i go about this?

View 2 Replies View Related

Randomly Generated Numbes

Aug 30, 2007

I wish to create a new sheet/workbook which promts the user to enter a start number and an end number. I want to then display 20% of randomly picked numbers between the start and end figures.

For example, the user enters 1 as a start and 20 as an end figure. 20% of this is 4, hence I want the system to randomly return 4 numbers between 1 and 20.

View 9 Replies View Related

Highlight Cell Based On Two Randomly Generated Number

Jan 19, 2014

I am trying to highlight a cell based on two randomly generated number, one is the column and the other is the row. Based on those values I want to change the color of a cell in a range of data. The formula I am using does not work like I intended. It only changes the cell once I enter a value in the cell not until. =OFFSET(A1,B27,B26). B26 and B27 are the cells housing the random numbers and A1 is the base reference.

View 1 Replies View Related

Excel 2010 :: Hyperlinks Randomly Disappear In Workbook

Aug 21, 2013

Hyperlinks are used to navigate internally throughout the workbook on a menu page and back. The hyperlinks started acting up after i saved to xlsm. Have since saved it back to xlsx but now the hyperlinks randomly disapper despite re-adding them over and over again.

View 2 Replies View Related

Excel 2010 :: Populate Ranges To Facilitate Dynamic Charts Being Generated

Nov 2, 2013

I'm trying to dynamically populate ranges to facilitate dynamic charts being generated.

I use excel 2010 at work, and 2011 for mac at home.

Dynamic chart ranges populated from named ranges as selected in nested indirectly sourced validation lists

I want any selection made in a dependent validation list which contains a list of named ranges to trigger a worksheet_change event which copies the range the selection points to and pastes it into a dynamic range in another column, beginning as a specified cell.I've tried using this, put together from some code examples from similar, but different issues.

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Me.Range("B2")) Is Nothing Then
Range(Range("B2").Value).Copy
Range("P2").Paste
End If
End Sub

Trouble is, I don't really understand this code. It doesn't appear to do anything when I make a worksheet change in "B2", but I don't know exactly what it is. I suspect that perhaps the fact that "B2" is validated from an indirect source might be difficult?

View 8 Replies View Related

Excel 2010 :: Linking Cells - Adding Names

Jan 14, 2013

I have an excel sheet (version 2010) that has a few sections that you can add in names (via drop down box). I also have a spot where i want these names to populate - on a second sheet.

Ex
Truck #1:
1. _____
2. _____
3. _____
4. _____
5.______

Truck #2:
1. _____
2. _____
3. _____
4. _____
5.______

Truck #3
1. _____
2. _____
3. _____
4. _____
5.______

Truck #4
1. _____
2. _____
3. _____
4. _____
5.______
6.______
7.______
8.______

My problem is when I refer to the first worksheet from the second worksheet it shows blanks where there are no names. For example i want the second sheet [ LOC ] to show the names that appear under Truck #1, #2, #3, #4 - but truck #1 may not always have names under it?

Sample Excel file attached - Help.xlsx‎

View 6 Replies View Related

Excel 2010 :: Adding Horizontal Line In Chart?

Oct 11, 2011

I want to a horizontal line in a chart. There are only two figures with me. One I want to display as a column chart. The other as a horizontal line chart. (I can use both excel 2003 or 2010, whichever is suitable)

View 2 Replies View Related

Excel 2010 :: Adding Negative Time Values

Mar 16, 2013

I have a problem with adding time values. The idea of my spreadsheet is to count time worked, and then calculate any variance from the normal shift length (i.e. 7h 30m). My formulas work fine until I work less than 7h 30m in a shift.

Example:

A1=start time
A2=end time
A3=IF(A2="","",MOD(A2-A1,1))
A4=IF(A3="","",(A3-(TIME(7,30,0))))

When the duration is over 7h 30m, A4 correctly returns the value of extra minutes. But when the duration is under 7h 30m the return is #####.

PS A1:A2 are formatted in a custom format hh:mm and A3:A4 are formatted as h:mm, and I'm using Win7 & MS Office 2010.

View 5 Replies View Related

Excel 2010 :: Adding Colored Shape (rectangle) To Footer?

Dec 19, 2012

I need to add a colored rectangle or box to a page footer in 2010 Excel.

View 2 Replies View Related

Excel 2010 :: Adding Percentage Change Column To Pivot Table?

Mar 17, 2012

I am trying to add columns to my Excel 2010 Pivot Table to calculate % change of sales from year to year. The field name is "Year", while the item columns in the field are 2007, 2008, 2009, 2010, and 2011. How do I add a column between the years that will calculate the % change os sales up or down from the previous year?

View 2 Replies View Related

Excel 2010 :: Adding Together Separate Currency Rows Based On Adjacent Column Value?

Dec 30, 2013

I have a spread sheet which totals the amounts in 2 columns D and E, which are pounds and pence. The formulas for each one are:

Pounds

=SUM(D3:D8)+ROUNDDOWN((SUM(E3:E8)/100),0)

Pence

=MOD(SUM(E3:E8),100)

These work very well and give me the correct figures.

What I would like to do is to add up the values of each row based on the criteria of column C and have just one value in ONE cell (as shown on lines 13 & 14), so for instance:

When added together the values of rows 3,4 & 6 are 7.25 (based on a value of "W")When added together the values of rows 7 & 8 are 5.00 (based on a value of "F")

I have tried to show this as an example in the image below:

A
B
C
D
E

[Code]....

I'm using Excel 2010 on Win 7 Pro.

View 3 Replies View Related

Dynamically Generated Range

Aug 14, 2007

I am have some code that takes values from a range (sourceAll) defined on my worksheet as:

Set sourceAll = Workbooks(pathnm).Worksheets(m).Range("A1", "S34")

I'd now like to be able for the range to be generated dynamicaly, but my problem is that the far right column (S) does not always have a value for every entry. Is there a way of using a column that does have a value for every entry, say column B, but then extending the range accross to S? If possible I'd like to avaoid having to move one of the columns with values for every entry. Auto Merged Post;I was looking at some of the suggested threads and found some code that I worked into my own

Set countRow = Workbooks(pathnm).Worksheets(m).Range("B1250").End(xlUp)
Set sourceAll = Workbooks(pathnm).Worksheets(m).Range("A1", countRow)
sourceAll = sourceAll.Resize(sourceAll.Rows.Count, sourceAll.Columns.Count + 17)

now this seems to work mostly, but it has deleted everything that was in column B.

View 2 Replies View Related

Excel 2010 :: Return Min Date In Range Where Adjacent Range Is Blank?

Feb 7, 2014

I am working in excel 2010. I have a tracking document that lists free tickets and their expiry dates. In the adjacent columns we track redemption details of these free tickets. What I want to do is return the oldest expiration date from A only if the ticket has not been used (i.e. B is empty). This will allow me to see the date the upcoming tickets about to expire so we can make sure they are used.

A________________B
Expiry Date________Redeemed by
15/08/2014
15/02/2014
15/08/2014________John
15/02/2010________Marc
15/02/2011________Bob

View 4 Replies View Related

Randomly Selecting A Cell From A Range

Oct 14, 2008

I need a cell to display the (text) content of 1 of 25 cells. example: I have text content in all cells ranging A1:A25. I want cell B1 to display the content of 1 of these at random. is there a function for this or do I need to use a macro?

View 4 Replies View Related

Return Value Randomly From A Range Of Cells

May 16, 2013

I'll be collecting registrations on an Excel worksheet at a company event. Users will fill out a registration form, click a button, and the information is moved to a hidden sheet. That part works perfectly.

Periodically during the day, we'll give out door prizes, selecting winners from the list of registrants.

I need a macro that will look at the entries in column A in my hidden sheet and return one of them randomly.

I know there are random number generators, and I could make one of those work, but if I could just have it make a random selection from the populated cells in Col A, that would be slicker.

View 9 Replies View Related

Excel 2010 :: Row Number Range From Date Range?

Aug 5, 2013

I have a column of dates in Col H with associated values in Col I. I need to specify a date range in Cell I1 and I2 such that the row number for the first encounter of the first date is placed in Cell I3 and the last encounter of the end date is placed in Cell I4. For example, with this data when I specificy 4/2/13 and 4/3/13, I would like to get a 19 in Cell I3 and a 53 in Cell I4.

Matty supplied the formula in Col K for each of these cells. They worked well in the application that I supplied earlier (different locations for these variables), but my real application is as shown here, and these two formula give the incorrect results shown. Both of these formula are arrays.

Excel 2010HIJK14/2/201324/3/2013310=MATCH(I1,INT(H10:H5000),0)+1444=MATCH(2,1/(INT(H11:H5000)=I2),1)+1536789X10 114/1/13 1:366.97124/1/13 2:04134/1/13 2:04144/1/13 4:563.95154/1/13 4:573.27164/1/13 5:165.55174/1/13 5:172.35184/1/13 10:30194/2/13 14:00204/2/13 14:59214/2/13 15:01224/2/13 17:192.81234/2/13 17:191.59244/2/13 17:252.14254/2/13 17:262.05264/2/13 21:07274/2/13 21:07284/2/13 21:11294/2/13 21:11304/3/13 1:38314/3/13 1:38324/3/13 2:10334/3/13 2:10344/3/13 4:24354/3/13 5:152.84364/3/13 5:154.11374/3/13 5:173.45384/3/13 5:173.24394/3/13 9:35404/3/13 9:35414/3/13 9:59424/3/13 10:01434/3/13 13:36444/3/13 13:37454/3/13 13:41464/3/13 13:42474/3/13 17:124.03484/3/13 17:133.62494/3/13 17:15504/3/13 17:15514/3/13 21:12524/3/13 21:13534/3/13 22:214.41544/4/13 1:52554/4/13 1:52564/4/13 1:53574/4/13 1:53Ppk Raw Data (2)

View 2 Replies View Related

Excel 2007 :: Colour In Workbooks Keeps Randomly Changing?

May 9, 2013

So, We are using Excel 2002 & Excel 2007 and for some reason all of the workbooks that we have open decide to randomly change the fill colours of nearly all the cells. The only reason this is an issue is that a lot of my work envolves me sending reports to clients and from a business perspective this does not look professional at all.

To add to this, once the cells have changed colour, the original colour is no longer available to select.

View 3 Replies View Related

Macro That Copies Unpredictable Generated Range So Can Paste In Other Programs

Apr 29, 2014

I have a macro that copies rows from my DAILY OCCURENCE sheet that have a YES in them to my MANAGER SUMMARY SHEET and G1 is selected which has a hyperlink that opens a new email with the manager's email address and Subject pre-assigned.

I then have to manually go back to the newly generated summary sheet and select the cells and paste them into the email that was just opened.

Is there a way that the generated rows are already copied in memory and all i have to do is CTRL+V into the new email, or even better, the cells are pasted in the email automatically? So basically either the information being copied over stays in memory, or after it is copied into the summary sheet it is copied again. I just dont know how to copy unpredictable ranges generated by macros.

The code that generates my summary sheet for my manager is below.

[Code] ...........

View 4 Replies View Related

Excel 2003 :: Saving Files Generated By External Application

Jul 23, 2013

I have the following code which edits an excel file and saves it in a different format, I think want the code to take this newly saved file and open it in an external application (Softplot) and then save it through this new application.

VB:
Sub FormatMacro1a(ws As Worksheet)
ws.Copy
Rows(1).Delete
Columns("D:E").Cut Destination:=Columns("J:K")
Columns("F:K").Cut Destination:=Columns("D:I")
Range("E1:E201").Value = "0"

[Code] .....

As it stands I have the file saving in a new format and I can open a specific file in softplot through VBA however where I am getting stuck is opening my newly saved file and then saving it.

I have tried the following :

VB:
Path = "C:Program FilesSoftPlot-8softplot.exe"
File = "ActiveWorkbook"

View 3 Replies View Related

Excel 2003 :: Adding Values If Column Next To It Is In Certain Range

Sep 9, 2013

I have this code working fine in excel 2007 but I need to get it working in excel 2003.

=0.02*(_xlfn.SUMIFS($D$2:$D$98,$C$2:$C$98,">="&I5,$C$2:$C$98,"<="&I4))

I have attached a test document to show what I'd like to do. It is basically adding values if the column next to it is in a certain range.

counting columns in Excel 2003.xls

View 3 Replies View Related

VBA Excel Macro Generates (Automation Error) Randomly Using Office 365

Apr 10, 2014

I have a VBA macro for automatically create a word report using data in Access and Excel. The macro is hosted within a Excel document but are using both Word-, Excel and Access objects/dataTtemplates for the creation.

The errors appears what it seems randomly. The macro iterates the same code a few times even in Office 365 but then it crashes. The most common error messages are:

Error 1:

Run-time error '-2147417851 (80010105)':

Automation error : The server threw an exception.

Error 2:

Run-time error '462':

The remote server machine does not exist or is unavailable

Error 3:

This action cannot be completed because the application () is busy. Choose Switch To to activate and correct the problem.

(no options are working, this hang the application)

If I debug usually the error originates from the code where I ether close the workbook template I'm using:

excelWorkbook.Close False

... or when I paste a chart from Excel to the Word report:

wordDocument.ActiveWindow.Selection.PasteSpecial

Even more strange are that sometimes if I continue to run the macro its all working again. This ONLY happens when the client office installation is O365. Office 2013 works just fine. I thought O365 and Office 2013 was fairly equal?

View 1 Replies View Related

Adding Items To Array From And Excel Range Based On Values?

Oct 2, 2012

On this is a column of Categories and a Column of sizes. I want to use these in a user form. The user will select their Category from a drop down list and the second drop down list will include only the sizes that appear next to the chosen category So for example in the attachment if the user chose 'AUD' as a category they would get the size choices of, '2x4 insert', '2x4 replica' and 'A4L' in the other drop down menu.

The master list of sizes will have to remain on a worksheet as this is what other operators will amend from time to time.

View 1 Replies View Related

Adding Values To Bottom Of Row In Range In Excel After Index Match

Jul 12, 2013

Basically, I am trying to write a program that will index match through a range and if it doesn't find the value that it is matching to, it will add the value to the bottom of the range it is indexing against. In other words:

My C column has a list of CUSIPS. In column J, I would like for the User to be able to add a list of cusips and then have the ones that don't already exist in the list of CUSIPS in column C be added at the bottom of the range. I have written a macro now that uses the index match, but for some reason it adds all of the cusips that exist in J range to column C, not just the ones that are missing. I can provide a template if necessary.

Sub Filler()
Dim Row As Variant
Dim NumberOfRows As Long
Row = 0

[Code]...

View 4 Replies View Related

Excel 2010 :: Cannot Delete A Range Name

Nov 28, 2013

Workbook contains a number of named ranges where the name is no longer used. I wish to remove the name assigned but not the actual range of referenced cells. When using Name Manager to try and delete the name the Delete button is greyed out and not available. Workbook is being heavily modified from its original form used by another. Is this possibly from a protected area from prior user? However, I have not had a problem creating new worksheets, cell ranges, etc. Also, even for new ranges I create I am not able to delete the name as the Delete button is greyed. What is going on and how can I delete just the unused range names? Version is Excel 2010.

View 3 Replies View Related

Excel 2010 :: Pivot Dynamic Name Range?

Jan 27, 2013

I am trying to insert a Pivot table with dynamic Name Ranges. It needs to start from Cell B1 as Column A has hidden formulas in them. I created an Dynamic Name range and tried to insert a pivot table. Excel then throws out a error stating "Data source reference is not valid". I tried re-saving the document but still no luck.

View 1 Replies View Related

Excel 2010 :: VBA - How To Convert A Range To A Table

Jan 27, 2014

I am relatively new to VBA and am trying to convert a range of data to a table in the same sheet. I receive the following message when I try to run the code as shown below:

"The worksheet for the table data must be the same sheet as the table being created." The code stops on the third line of the code.

Sheets("Data Forwards").Select
ActiveSheet.Range("$A$1:$U$1000").Select
ActiveSheet.ListObjects.Add(xlSrcRange, Range("$A$1:$U$1000"), , xlYes).Name = _
"Table1"
ActiveSheet.Range("Table1[#All]").Select
ActiveSheet.ListObjects("Table1").TableStyle = "TableStyleMedium2"

I can see that the range is highlighted in the sheet before the code breaks.

View 3 Replies View Related

Excel 2010 :: VBA Input Box For Range Selection

Sep 6, 2012

Excel 2010. I have a macro, stored in a workbook.

The macro is: collecting data from another opened workbook,processing the data,saving the processed data in yet another workbook.

The workbooks' names it is operating on are hardcoded in the macro. I'm trying to make it more flexible, that is to allow user to specify both source and target workbooks along with the data columns.

The workflow follows:

User opens both source and target workbooks,User opens the workbook with the macro,User runs the macro (with a button for example),Macro prompts the user to select range in the source workbook,Macro "memorizes" the range and the source workbook's name from user's selection,Macro prompts the user to select range in the target workbook,Macro "memorizes" the range and the target workbook's name from user's selection,Macro processes the data.

I found out that this can be achieved with Application.InputBox("Select cell(s)", Type:=8) method. However there are some issues that I was not able to solve playing with the returned value's methods:

The .InputBox defaults to active workbook. I was able to select another opened workbook only with Ctrl+Tab combination, but it will not work with the end users - they are too poor with these tricks. Is there a better, more intuitive way to allow user selecting a workbook?I was not able to get the workbook's name from the .InputBox returned value property. I was trying with .application.caption and .application.activeworkbook.name - none of these worked. They returned name of the workbook with macro, not the one with selected range. How to get the workbook's name from given cells range?

View 2 Replies View Related

Excel 2010 :: Allowing Edit On Specified Range

Jan 6, 2013

Run on Excel 2010

Sub UseChangePassword() Dim wksOne As Worksheet Set wksOne = Application.ActiveSheet
' Protect the worksheet. wksOne.Protect ' Establish a range that can allow edits ' on the protected worksheet.
wksOne.Protection.AllowEditRanges.Add _ Title:="Classified", _ Range:=Range("A1:A4"),
_ Password:="secret" MsgBox "Cells A1 to A4 can be edited on the protected worksheet."
' Change the password. wksOne.Protection.AllowEditRanges(1).ChangePassword
_ Password:="moresecret" MsgBox "The password for these cells has been changed." End Sub

The red color code is giving error message: Application defined or Object defined error.

View 1 Replies View Related

Excel 2010 :: Autofill Ever Changing Range?

Jan 23, 2013

Excel 2010

I have this code in a macro, the range will change as more data is added. so that I dont have to keep changing the range. How can I have this code autofill from the activecell to the last cell that has data in column M.

Selection.AutoFill Destination:=ActiveCell.Range("A1:A50000")
ActiveCell.Range("A1:A50000").Select

View 7 Replies View Related







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