Store A Value Without Storing It In A Field
May 17, 2007
Can I store a value with out storing it in a field? -with the macro ending?
Ex macro1 runs and gets A1.value
Stores the value (Not in a cell)
I later run macro2
Gets the stored value
View 9 Replies
ADVERTISEMENT
Jun 17, 2009
I want to create & store ad-hoc tables in excel.... can anyone suggest the best way of doing this? Maybe can i use some sort of marker to distinguish when one table ends, and another begins? For eg, maybe i want to store 3 tables - 1 of different fruits and fruit volumes, the 2nd of employees and their shift times, and the third of various different leaflets, paper codes, volumes and dates.... eg, no particular theme
View 9 Replies
View Related
May 18, 2006
I have solution that uses userforms, the intro/menu has a company logo on it. What I want to be able to do is use this logo on actually worksheets that I have set up as templates for sending out invoices etc.
The person I am doing this for sometimes uses pre-printed headed paper and sometime plain papper. So I have a check box that asks whether headed paper is used. If so not a problem, if not, I need to add the logo at the top of the page, ideally from within the workbook.
View 4 Replies
View Related
Feb 20, 2007
Here's the code linked with excel spreadsheet:
Function Function1(DailyClose, EFBillsYield)
TradingDays = Application.WorksheetFunction.Count(DailyClose)
For i_cnt = 1 To TradingDays - 1
DailyReturn = Application.WorksheetFunction.Ln(DailyClose(i_cnt) / DailyClose(i_cnt + 1))
Next i_cnt
AnnualReturn = Application.WorksheetFunction.Average(DailyReturn) * TradingDays
AnnualVolatility = Application.WorksheetFunction.StDev(DailyReturn) * Sqr(TradingDays)
RiskFreeRate = Application.WorksheetFunction.Ln(1 + EFBillsYield)
Function1 = (AnnualReturn - RiskFreeRate) / AnnualVolatility
End Function
When I enter the parameters DailyClose (which is an array of numeric), and EFBillsYield, which is a numeric also, the function will calculate the DailyReturn (in array) for each array element in DailyClose.
The problem is, I don't know how to catch the DailyReturn for each DailyClose element. The above code only loops and calculates DailyReturn one by one, but not storing it as an array.
How should it be modified so that the DailyReturn can be numeric array also, so that it can perform average and SD functions below the loop?
View 4 Replies
View Related
Jul 4, 2013
In the following extract, I would like to have today's date placed into Col K when an entry is made into Col J.
Entry into Col J is from a validation list of 3 options. What I desire is that when one of these options is selected ("Complete"), then I would like today's date to be written into Col K.
Currently Col K has a validation list which comprises dates from 1st of each month from July to June.
I need a fixed date as text preferably, so was thinking the VBA function "Date" on a Change Workbook Sub.
The information is currently part of a Table in Excel 2007 that has about 500 records.
IdeasList
*
J
K
2
Status
Month Completed
3
In Progress
*
4
Complete
Jul-13
5
*
*
6
*
*
Data Validation in Spreadsheet
Cell
Allow
Datas
Input 1
Input 2
J4
List
*
=ValidationList_Status
*
K4
List
*
=ValidationList_Months
*
View 2 Replies
View Related
Apr 1, 2009
I've created a workbook that I use daily. The workbook has two sheets. One for entering information. The other for storing information.
On the first sheet, I enter health information about myself. I also enter the date.
On the second sheet, I have rows dated from January 1, 2009 to December 31, 2009. If the date entered on the first sheet matches January 1, 2009, then the information is copied to that respective row. If the date entered on the first sheet matches January 2, 2009, then the information is copied to the corresponding January 2, 2009 row, etc, etc.
So far so good. I enter the information, the date, and instantly the information is copied over. I save the workbook and go to sleep happy................
View 3 Replies
View Related
May 19, 2008
I have an Add-in that creates and formats reports for various users.
Within the add-in I have rules set to disable some buttons on a userform untill a process is run to enable them. I am doing this through the use of a variable - set as "0" untill such a time when the process is run that it will set the variable to "1". A function is then run to enable all of the buttons.
However, once excel is shutdown and re-openned - it resets the variable to "0" for no apparent reason. Is this normal? Is there a way around this - so that the Add-in remembers what the variable was set to before closure?
View 9 Replies
View Related
Nov 23, 2009
I am trying to store a variable (I will highlight it in red below) to be used later in the same formula. The formula I have now works, but it puts the variable in cell G20, and I do not need this variable anywhere on the sheet. However, I do need it to perform some calculations later in the code.
View 14 Replies
View Related
Jul 10, 2013
My code needs to find the last date listed in column A, which it already can do. And calculate how many days have passed between today and that date it finds in the column. Which I think my code can already do.
How do I store the number for later use?
Meaning, the next part of this code is going to send a request to a website to retrieve however many days of data that number is to be above ^. So it might be 2 days, 12 days 7 days, who knows...but the http request part will come after.
Code:
Sub date()
Dim lngLastRow As Long, lngRow As Long
Dim strColumn As String
strColumn = "A"
With ActiveSheet
lngLastRow = .Cells(.Rows.Count, strColumn).End(xlUp).Row
For lngRow = 2 To lngLastRow
[Code]...
View 4 Replies
View Related
Jul 11, 2014
I'm setting up a type of form in excel where I have some validated drop down lists and I'm trying to use a macro that will, upon a button click, take the data from the drop down lists that are entered into the boxes, and organize them into a chart on a different sheet of the document. This would be the form with some drop down lists.
Juice Type
Apple
Juice Size
8 oz.
Juice Buyer
Ronald
I want to add it in to a table with every button click filling in a new row in a table like this,
Juice Type
Juice Size
Juice Buyer
Apple
8 oz.
Ronald
View 3 Replies
View Related
Jun 9, 2006
I have a macro that imports a report. If the Charge Type in column A is BTOREPLX, I need to prefill the field next to it in column B with the text "REPLX", e.g. "REPLXCDROM". I've attached an example of the report.
View 5 Replies
View Related
Apr 23, 2008
In building my pivot table my data that I want to show in the column area is showing up as rows stacked on top of each other. In the column section I'm trying to show Total Budgeted Amount next to Total Actual Amount but on the layout it's showing the two stacked on top of each other is there some kind of hidden key that I'm missing?
View 3 Replies
View Related
Sep 17, 2013
I would like to know that is there any way of recording criteria when I filtered data.
For example; A1,A2,A3,A4,A5,A6,A7,A8,A9,A10 and A11
I have this data such as Data,1,2,3,4,5,6,7,8,9,10 (starting from Range A2). Now when I created auto filter as
VB:
ActiveSheet.Range("$A$2:$A$11" _
).AutoFilter Field:=1, Criteria1:=Array("2", "3", "4", "5"), Operator:=xlFilterValues
And this criteria can be changed by the user anytime. Now for some reason sometimes I trigger a code which works under Function key(F8) and it refresh some data from the database. Just before it gets the data, it will remove the filter such as :
VB:
ActiveSheet.Range("$A$1:$A$11" _
).AutoFilter Field:=1
My problem is after I run my code (under F8), I want to filter back with the same criteria. Is there anyway that i record my criteria in any cell whenever I filter?
View 2 Replies
View Related
Mar 6, 2009
I need to associate a fairly long (800 characters) string with a workbook as a template SQL query for an ODBC connection. I've thought about putting it into a cell, into a shape, into a standalone VBA module (with some 'magic' to stop it compiling). All I need is to be able to access it fairly easily via VBA (which I'm comfortable with).
View 3 Replies
View Related
Dec 14, 2011
This challenge may be better handled in Access or a true database but the person making the request only uses Excel.
1. Create a form that will accept names, dates, and grades.
2. Store the information on a separate worksheet so that it's being accumulated and reports can be ran from it.
I'm aware of Excel's automatic form but it doesn't allow for validation.
Example: some score ranges are 0-5 others are 0-15. We can't allow for a 12 to be put in where the max is 5.
I know how to do the validation. The big challenge now is telling Excel: I've completed entering this record. Now clear, and start a new record on the next row?
View 2 Replies
View Related
Feb 13, 2012
I've created a textbox, call it Textbox1, where I've set EnterKeyBehavior and WordWrap to be true. If someone types something like
apples
bananas
cherries
in the textbox, and I use the following code
Code:
Dim TextBoxVal as String
TextBoxVal = Textbox1.Value
then TextBoxVal will be applesbananascherries.
I'd like to have the array be something like
apples,bananas,cherries, or
applesX_X_XbananasX_X_Xcherries,
or something else so I can tell when the user has hit the enter key. Is there any way to do this?
View 3 Replies
View Related
Nov 30, 2006
I am writing a macro that allows a user to select which fields they would like to copy from over 100 workbooks. I am using a multiselect ListBox on a userform that I populate using the "additem" approach. There are around 20 fields for the user to choose and each represents a column in the worksheet (all 100 worksheet are in the same format).
I need to use the user selection to identify which columns to pull from all worksheets.
How can I identify the selection the user made and incorrporate that in a copy range type of code. I planned to "Unload" the form after the user hit the "Run" (command) button (not sure if this will matter).
View 9 Replies
View Related
Jun 29, 2007
I have the following code for a user-defined function:
Function SeriesSum2(A, B, x, C, D, y, z, Num)
Summation = 0
For i = 1 To Num
Summation = Summation + (((A - B) * (((0.01 * B / (A - B)) _
^ (1 / (y - 1))) ^ i) + B - x) / ((1 + x) ^ i))
Next i
Product = 1
For i = 1 To Num
Product = Product * (1 + ((C - D) * (((0.01 * D / (C - D)) _
^ (1 / (z - 1))) ^ i) + D))
Next i
SeriesSum2 = WorksheetFunction.SumProduct(Summation, Product)
End Function
To simplify, suppose Num = 3, and the three terms of Summation are {3, 5, 9}. Call these S1, S2, S3. Further, suppose the first three terms of Product are {1, 4, 12}. Call these P1, P2, P3.
My desired result of the function is 3*1 + 5*4 + 9*12 = 131. Instead, I'm getting 3*12+5*12+9*12 = 204. That is, the function is returning S1*P3+S2*P3+S3*P3, while I want S1*P1+S2*P2+S3*P3.
Can anyone instruct me as to what I need to do to get my desired result? I'm guessing it has something to do with storing Product as an array, but I'm a very novice VB'er, so I'm not sure.
Of course, if there are any other glaring errors in my code,
View 9 Replies
View Related
Dec 27, 2006
I have tried lots of alternative for making Excel Dates & Times calculation work in vba. I can't find the place its creating problem. I have attached spreadsheet to have better look at it. When I am using time in one column (Calender!C) in VBA code, it works fine and update values in R1,R2... columns. But, when I am using time in another column (Calender!D), its not working properly and not updating appropriate columns. I will appreciate if someone can look at vba code in attached file. It looks like I am missing some kind of setting in excel/vba.
View 3 Replies
View Related
Jun 1, 2007
I have created a 3d array in visual basic that i want to access from a worksheet. it is basically a linked set of 2 dimensional arrays (i.e. there a x items with a x b data arrays). I want to stored in a named range, as a and b may both be more than 255 (i.e the width of a worksheet). is there an easy way to store and reference a 3d array in a name, or will i have to store each a x b array as a seperate name. Also, if I have to store them separately, is there an easy way to strip the component parts of a 3d array into 2d arrays?
View 2 Replies
View Related
Feb 13, 2013
I have a simple formula ='info page'!b2&'info page'!b5 in places that on my sheet adds a company prefix to a item number, prefix in b2 and item in b5, we have a client that we cant use prefixes but now when I leave the field blank its giving a zero and thats not good either. I'm pretty sure an IFERROR or something will work but can get the syntax right.
View 5 Replies
View Related
Feb 18, 2013
I have two cells. One of which contains a String and other contains a date value. I need to concatenate both and use it as a key for vlookup function.
Cells(x,y)= "=VLOOKUP($B7&TEXT($F6,"mm/dd/yyyy"),'Copy Data'!H2:J161,2,FALSE)"
OR
Cells(x,y)= "=VLOOKUP(CONCATENATION($B7&TEXT($F6,"mm/dd/yyyy")),'Copy Data'!H2:J161,2,FALSE)"
In my resultant cell formula looks like =VLOOKUP($B7&TEXT($F6,"mm/dd/yyyy"),'Data'!H2:J161,2,FALSE) itself and the expected result is not achieved.
Eg: B7=04152AB F6=21/12/2010 I need to merge both values and use it in vlookup for finding match from another sheet named 'Data'
View 2 Replies
View Related
Mar 14, 2014
Our client uses an Excel spreadsheet that we provide to adjudicate/comment on our delivered products (primarily documents and reports). The spreadsheet has columns for:
DefectCode, SectionPage, Comment, FinalDisposition, FinalComment.
At the end of the process of client meetings and revisions, we must generate an MS Word-formatted report. I've written a macro to parse the comments and columns and generate a mostly-formatted Word document. What's missing are the corporate headers, footers, logos -- the standard template or basic document stuff that all of the details would fill in. For now, I auto-gen a Word document and merge it by hand into the corporate template.
So my question is: if I want to "include" a corporate Word template with the spreadsheet, can I bundle it with the workbook somehow or must it always remain a separate file?
My current thinking is that since a *.xlsm file is really a ZIP file underneath, could I store the Word template there where it would effectively be hidden from the user? Or what is the best way to bundle an extra file like this with my workbook app?
View 2 Replies
View Related
Aug 20, 2008
I was able to get some help a while ago and hoping for someone to reply as well. Any one have ideas how to create a userform which will be use for username and password input? I know how to create one but is there anyway that the username and password will be stored as .txt file instead of using worksheet to store the data?
View 14 Replies
View Related
Dec 31, 2008
I have piece of code that I'm trying to make dynamic. I want to store parts of an IF statement in a variable and use them when I need them. Here's a little sample of what I'm trying to do
View 9 Replies
View Related
Jul 28, 2009
I am having some trouble with the "mid()" function. I have it saved as a variable which pulls 6 digits from another variable. I was trying to paste from the mid variable into my excel worksheet but it keeps on telling me that there is an object required error.
The goal is to input the "mid()" output in my code into a cell in the spreadsheet.
Here is some sample
View 4 Replies
View Related
Sep 7, 2012
Excel 2007.
I'm basically copying and pasting a bunch of columns. Currently, my code is very long because I'm not using a loop to plug in the column header. how I'd store all the column headers in an array (I think) and loop through 1-by-1.
Here's a look at what I'm doing now:
Code:
' ''Project Number
x = "Project number"
i = Sheets("RawData").Rows(FirstRow).Find(x).Column
[Code]....
how to store these column headers in an array and then pull them?
View 4 Replies
View Related
Apr 13, 2014
I am working on my project for VBA and I need to make a program for Large Factorials sch as 25!, which is too big to fit as a Long-integer. I basically have to find a way around this by storing the numbers as arrays F() and C(). Array F is for the multiplication of each cell of memory, and C is for the carries, which will later be added. I need to separate the hundreds, tens and units of each multiplication.
To Further explain, lets say I have 12!; to find this I would take the previously calculated 11! (by using a loop) and multiply 12 by each memory cell of the array F(). So it's kind of like multiplying by hand, you bring down the units and put the carries on top to be added later. I would store the carries as one or two memory locations over of the current I, or the current loop number. So the units of the mult. would be stored as F(I), the tens would be carried and stored as C(I+1), and the hundreds would also be carried, but this time two cells over, so C(I+2)
The main problem I have is finding the proper code to split the number into units, tens, and hundreds, and then assigning them to their appropriate memory cells within their respective arrays.
Here's what I have so far:
Code:
Dim F(1 To 30), C(1 To 30), N As Integer, Fact As Long, Length As Integer, space As Integer
Sub LargeFactorialCalc()
Open "F:project.txt" For Output As #1
F(1) = 1
N = InputBox("Enter the number you would like to take the factorial of: ")
[Code] .......
View 3 Replies
View Related
Oct 10, 2009
I have a formula utilizing a random number generator that produces a new number every time I hit the F9 button. I want to accumulate 1,000 values for these numbers, but I don't want to take the time to write down each number (copy and paste). I would like to simply hit F9 and have the value stored in a cell that then steps down so when I hit F9 again it records the new number, so at the end of the sampling, I end up with a column of 1,000 numbers
http://www.triplescreenmethod.com
http://www.twitter.com/triplescreen
View 9 Replies
View Related
Feb 4, 2010
I am setting up a multiple listbox and trying to store the chosen values in one cell. I found a good reference on here but can not get it to work.
On my tab named "input" I have a listbox named "AppListBox"
When the user finishes choosing, I want all the values to go to one cell (H40) with a comma separating them.
Here is what I have within the Input tab code.
Private Sub AppListBox_LostFocus()
Dim s As String
DIm i As Integer
With AppListBox
For i = 0 To .ListCount - 1
If .Selected(i) = True Then s = s & ", " & .List(i)
Next i
Range("H40").Value = S
End With
End Sub
View 9 Replies
View Related