Action With Cell Reference
Feb 20, 2009
I have the following problem to solve:
Cell x in col K is filled with a col number e.g. 'V' (validated via validation list).
Cell x in col L is filled with an amount.
How do I get the amount of cell Lx into cell Vx? This to be done only when the amount Lx not equal to zero.
Can this be done with a formula, or do I have to use a macro? I tried to find the solution for both options, but sofar I have nothing that works. Via the Excel help I could not find the solution. I know how to create a macro activated via a button. I prefer automatic filling by Excel.
View 9 Replies
ADVERTISEMENT
Oct 29, 2009
(using excel 2k7)
Is there a way to create an in-cell dropdown list, then when only 1 item is selected an action is done, plus this has to be repeated for at least 20 rows, preferably 200.
I can do it with an activeX combo box, but that will be tedious and looks messy. The form control box's were linked, or at least when I created them.
Data validation is the prefered method for my drop down list. It looks neat and is easy to replicate for 200 rows.
View 9 Replies
View Related
Jun 13, 2014
Per the table below, I compute how many months to average project costs over, establish month in which the costs begin, and these accumulate in the work in progress (WIP) end columns, however in the month the final stage (to hit 100%) of costs are complete, the project is invoiced and the WIP is released - Noting the month in which the last costs are incurred are not added to total to reverse out. The 3 projects and final columns demonstrate the different scenarios and the results I would expect to see, I just can't formulate anything to release the previous months WIP without it repeating the negative for the rest of the year - if that makes sense?
Sheet1 *ABCDEFGHIJKLMNOPQRSTUVW1
*********Project start point*Forecast costs incurred*Work in progress2**% project complete
****** * * * * * * 1 * * * * * 2 * * * * * * * 3 * * * * * * *4 **********3
ProjectJun-14Jul-14Aug-14Sep-14CostsStagesMonths*Jun-14Jul-14Aug-14Sep-14
[Code] .......
View 2 Replies
View Related
Dec 4, 2008
I have made a Pop Up Calendar for my worksheet Called frmCalendar.
How do i get it to activate as soon as a user clicks in the appropriate cell?
Can i get it to activate on a column (All cells in the column) as opposed to just a single cell?
View 9 Replies
View Related
Feb 7, 2007
I have a macro to copy/paste B14 to B14 in next months workbook. Once a year the event occurs twice in a month, resulting in B14 and B15 both having values, the other 11 months B15 is blank. For this one month I need to copy/paste B15 to B14 in next months workbook. The macro is quite long. So it is If B15 has value then copy/paste B15 to B14 in Feb workbook, otherwise copy/paste B14 to B14 in Feb workbook. Unable to work it out myself.
View 8 Replies
View Related
Feb 6, 2008
I ahve looked loads on here but I really did not understand the " find" statement (!) so have had to do a lookup the only way I know - with loops.
I have two problems:
The first being that it takes 6mins to run and return values.
The second AND MOST IMPORTANT is the following....
What i want to do with the following code is - on the first "If" - if I find an emptycell/blank, i want to exit the "if" so the first "next" statement is incremented - in other words, be able to check if the next cell along is blank/non-empty
I tried using the "exit for" but I only want to opt out of the if statement - not the actual "for..next"
I would have used a goto to get to the line I wanted but it has different meanings with this language....
Numrows2 = Worksheets("File2").Range("A65536").End(xlUp).Row 'Gets the File2 Row count
For e = 2 To 7 'Cols B-G (2-7) contain the headings
For d = 1 To 229 'There are 228 cells down to check
For f = 7 To 212 'File1 has 206 cells across cols 7-212
Worksheets("Looklist").Activate
If IsEmpty(Worksheets("File2").Cells(1, f)) Then
Exit For
View 4 Replies
View Related
Dec 18, 2008
I have a range of cells that I want to watch for a change in contents. If any cell in the range has a change in contents I want to launch a MessageBox that asks if they wish the new value to be entered automatically in all of the other cells in the range. Example:
Range = B8:M9
User changes F8 from "empty" to 38. MessageBox should launch asking if they want 38 to be entered into all of the cells in the range. Upon answering yes new contents of F8 should be inserted into the rest of the range.
View 4 Replies
View Related
Jun 22, 2009
I have an excel file that contains two sheets. Sheet2 contains rows of different types of products with each of the columns containing details about the product.
On Sheet1, I have setup a data validation list in which a certain cell contains a drop down box that selects a product from the first column of all the rows on t from Sheet2. I used
View 3 Replies
View Related
Mar 10, 2014
Converting old reports to usable excel format. I am having trouble using VBA to set up a looping macro that would search Column A for cells with the text string: "ACTIVITY TOTAL". If cell has that value I would like to perform text to column action on the adjacent cell (R0C1). The macro recording for the test to column settings i need is :
Selection.TextToColumns Destination:=ActiveCell, DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=True, Tab:=False, _
Semicolon:=False, Comma:=False, Space:=True, Other:=False, OtherChar _
:=":", FieldInfo:=Array(Array(1, 1), Array(2, 1), Array(3, 1), Array(4, 1), Array(5, _
1), Array(6, 1), Array(7, 1)), TrailingMinusNumbers:=True
I have attached a sample of what I am currently working with. The actual file has roughly 6000 lines of data, so I would like the macro to go through all lines.
Attached File : LoopingVBA.xlsx
View 3 Replies
View Related
Sep 27, 2012
I am about to write a small macro to do a iteration calculation. I would like though for the user to select me a cell so that the macro uses the value in that cell to start calculations. Now, what I think would be the problem is how do I code a "time" or notice an action such as clicking in a cell to continue with the macro.
Would it be by inserting a pause in the code of a certain time so that gives the user time to click and wait for the code to start? If so, how would much time is enough? Is there another thing that could restart the code such as "noticing a click in a cell" command in VBA?
View 1 Replies
View Related
Jan 8, 2012
How do I change a formula cell reference based on another cell's reference? I'm building a schedule that looks to a task's trigger and adds days based on that relationship. All entries in column "A" will be text and all cells in "B" will be the simple formula "=A2" or "=A3". Due date is calculated by adding the value in "C" to the preceding date in column "D". In the spreadsheet below, the trigger for "Budget set" is "Specs written" with 3 days added to the previous due date.
________A________________B_____________C_________D
1 Task___________Trigger_____________Days_____Due Date
2 Design begins__Proj OK______________10____10-Jan
3 Specs written__Design begins (A2)____5____15-Jan (D2+C3)
4 Budget set_____Specs written (A3)____3____18-Jan (D3+C4)
If the trigger for A4, "Budget set", changed from A3 to A2, is there a way that the formula that determines the due date in D4 could read the trigger cell reference in B4 so that the value in the corresponding row in column "C" is added in the date column?
View 4 Replies
View Related
Mar 11, 2009
I have a table that displays data from another worksheet. This is what the cell reference behind the table look like:
View 2 Replies
View Related
Feb 15, 2010
I have lets say 12 months of data. I have formulas that reference the latest 6 months. When I insert a new column to input a new month, how can I make the formulas include the new months without manually updating them.
EXAMPLE:
12 months of data exist in cells B3:M3 going from B3(oldest) to M3(newest). Formulas reference latest 6 months of data in cells H3:M3. When a new month hits, I insert a column after column M.I would like the formulas to now reference cells I3:N3 which is now the newest 6 months.
View 14 Replies
View Related
Jul 20, 2014
I have a workbook with 1000+ worksheets, all of which have 3-letter names. On a master sheet, I would like to make a query of how many non-empty cells there are on a subsidiary worksheet. This works:
Code:
=COUNTA(ABC!A:A)
What I'd like to do from time to time is input in column A a varying set of 3-letter worksheet names, say
AAB
ABC
CDE
And have a formula in column B that converts this to
=COUNTA(AAB!A:A)
=COUNTA(ABC!A:A)
=COUNTA(CDE!A:A)
I've learned that simply substituting the cell references A1, A2, A3 for AAB, ABC and CDE doesn't work. What do I need to do to achieve this?
View 2 Replies
View Related
Apr 25, 2014
Let's say I've ended up with the number 8 in Cell D4 for example. Is there a formula that can return the letter "G" (The 8th Column) so I can use it in future cell references ? If so, let's say we store that in Cell B5. How do I now refer to a cell in a chosen Row of that same Column by reference to Cell B5 ? For example if I want to refer to Cell G33 can you refer to this Cell in some form like Cell(Contents of Cell B5;33) ??? Don't want to use R1C1 type references if possible.
View 9 Replies
View Related
Apr 27, 2009
How to set a password before executing any action.
For example, I have "cancel" button in my userform. If i click "cancel" it unloads the form. Instead of that i need a password prompt. so when i click the "cancel" button ,it should ask for a password. only if i provide the correct password then only the form should be unloaded.
View 6 Replies
View Related
May 28, 2014
JSON import to Excel - Stack Overflow
I understand most of what this post is saying, but I don't understand how to put it together in an excel module or class module.
View 5 Replies
View Related
Jul 18, 2006
I have a database in excel which I want only selected users to have edit rights & others should have readonly rights. I have written the following code where a pop up would appear in selected cells warning user for editing the said cell. What I want is when a user clicks yes he should be able to edit it & when he clicks no the cell should get protected.
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
Dim rTriggerCell As Range
If Not Intersect(Target, Range("D1:D100")) Is Nothing Then
Set rTriggerCell = Target
Application.EnableEvents = True
If MsgBox("Edit Cell?", vbYesNo)
End If
On Error Goto 0
Exit Sub
End If
View 6 Replies
View Related
Jun 11, 2008
I have 5 columns set up: A,B,C,D,E
D is the sum of A and B
E is the sum of A,B,and C
As I add in a new column to the right of C (call it C2), I need D (which has shifted over one) to sum A,B, and C.
I also need E (which has also shifted over one) to sum A,B,C, and C2.
Essentially I need a function in a cell that will be able to reference two cells to the left even as more cells are added.
View 9 Replies
View Related
Oct 21, 2008
How do you set the code so that, if a condition is met, then several cells are filled with values?
So far, my code is
HTML If Cells(i, 2) < Cells(i, 4) Then
Cells(i, 5) = "A"
Cells(i, 6) = Cells(i, 2)
End If
View 11 Replies
View Related
Nov 19, 2008
I am trying to loop through an action within a macro and require some assistance.
I have the following
View 2 Replies
View Related
May 30, 2009
I have a spreadsheet that when I am running an specific macro and userforms, this one sheet is visible, when the macro is not running, then, the sheet is hidden.
Now, that happens automatically the way that I set up my macro; however, if the macro is aborted, the sheet doesn't hide.
View 7 Replies
View Related
Aug 13, 2009
If I press either the "OK" or "Cancel" button without entering any states in (because I changed my mind and want ALL states in there, or I pressed either button by accident), the macro eliminates ALL the rows because it needs criteria.
Can this code be modified so that the message box does the following...
1. If I press the "OK" button but I haven't entered in any criteria in the message box, bring up another message box saying "you have not entered in any states in" which brings up an "OK" box and brings you back to the original message box.
2. If I hit the "Cancel" button, bring up a message box that says "No states will be removed" with an "OK" button, essentially cancelling the "State" macro portion of the sub, but continuing with the rest of the code in the sub if there is any.
I would like to have this message box work this way even if states were entered in the input box but the user pressed the "Cancel" button anyway.
3. Create a NEW button named "Keep ALL States" which essentially does the same thing as the "Cancel" button. (I'm trying to "idiot proof" this).
View 4 Replies
View Related
Feb 1, 2012
I have created vba which I want to comment out. I totally stumped how to create this action on vba. My current vba code which I want to comment out using vba
Code:
Option Explicit
Sub YearlyInput()
End Sub
'Speeding Up VBA Code
With Application
[Code] .......
View 8 Replies
View Related
Aug 24, 2012
I have a for which consists of
2textbox
1 listbox
1 textbox.
While entering the data, the cursor does not stop in the list box and goes directly goes to the next textbox. Autotab is set to true.
View 4 Replies
View Related
Nov 23, 2007
I have a macro that is working fine. It calculates some values based on a SQL database and then copy the values and paste them into another spreadsheet.
However, I need to repeat the same procedure 1296 times.
Please see below the macro.
Sheets("QUERIES").Select
Range("C1").Select
ActiveCell.FormulaR1C1 = "2"
Range("C5").Select
Selection.QueryTable.REFRESH BackgroundQuery:=False
Range("D5").Select
Selection.QueryTable.REFRESH BackgroundQuery:=False
Range("C5:G5").Select
Selection.Copy
Sheets("AWB RANGE").Select
Range("K2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
I need to increment the line #3 (ActiveCell.FormulaR1C1 = "2") that should start with 2 and end with 1296.
Also, I need to increment the line #11 (Range("K2").Select) that should start with K2 until K1296.
The other parts of the macro will not change.
Would you be able please to give me a hand on this explaining how to create a counter to start on 2 and stop with 1296 ?
View 9 Replies
View Related
Feb 25, 2008
Last friday my personal.xls file went missing. I cannot find it anywhere which means I am missing about 10 key macros. While it is not the upset of the century, my problem is that now when I go into Record Macro and try to "Store New Macro in:" -> "Personal Macro Workbook" and then click OK, Excel brings up a msg box that says:
Personal Macro Workbook in the startup folder must stay open for recording.
Click OK and Excel says:
Unable to Record
View 9 Replies
View Related
Aug 14, 2008
What i have is a userform which contains textboxes a user can enter or change data in.
What i'd like to do is to have a button called something like "undo last" whereby a user can 'swap' back the last change they made.. does anyone have any idea how i might go about it?
View 9 Replies
View Related
Feb 16, 2007
What code do I need to have behind a command button to carry out an action (for example select cell A1 or B1) depending on which one of two radio buttons are selected? I have tried:
Sub Button23_Click()
If Opt1 Then
Range("A1").Select
End If
End Sub
View 9 Replies
View Related
May 13, 2014
I have an excel Workbook made up of sheets that are named after months ("May 2014", "Jun 2014" etc). I want to pull data from each sheet that comes after a user specified date.
View 3 Replies
View Related