Macro To Effect Cell Based On Column
Nov 26, 2008I wasnt sure how to name this problem, but here goes.
View 3 RepliesI wasnt sure how to name this problem, but here goes.
View 3 RepliesNot sure what formula to use for this set-up:
Col1 - Name_Last
Col2 - Name_First
Col3 - Ref_Name
The desired effect is under column 3, you have "Name_First Name_Last". Attached sample file.
Is there any setting or technique to limit a macro to only effect the open sheet in the workbook that it runs from?
View 1 Replies View RelatedI'm trying to create a macro to add a fill effect on the bars of my chart.
However, I don't want it to change the bar's current color. Just to do the effect on the current color.
Code:
Sub fill()
ActiveChart.SeriesCollection(2).Select
With Selection.Border
.Weight = xlThin
.LineStyle = xlAutomatic
End With
[code].....
Here's a problem I'd like to be able to solve in VBA:
Retrieve the current cell color (let's say A1 = 'green')
Format A1's cell colors (using the VBA equivalent of the 'Format Cells' / 'Fill' / 'Fill Effects' / '2 color Gradient' feature) so that the background cell color (color 2) is set to 'green' with color 1 being set to 'white' with a shading style of "From Center"
I'm using Excel 2010.
I work on an excel spreadsheet all day and I'm constantly cuting and pasting a value to filter another column. I would love to have a macro button that would automatically do this.
The job card sheets are labled 'Page 1' through to 'Page 175'. As I am working on each job card sheet I need to filter column on another sheet within the same workbook. This is indicated on the attached picture.
So in a perfect world as I would enter in the PLANT ID number on to any job card, then hit a macro button on the toolbar and the Pole No column would then be filtered by the value in the PLANT ID cell.
As there are multiple job cards the macro would probably need to use the 'active cell' value to filter by. But as you can probably tell I'm no expert so you judge the best way to do it.
MWTS034G22 Job Card Sheet
[URL] .....
Windows 7 (32bit)
MS EXCEL 2010
I have data in E6-E67 on Sheet 1. Based on the date in A2 on that sheet, I need to paste to a column in Sheet 2. In excel, I am able to get the cell location through vlookup and get the correct column number/cell reference. When it gets to the paste location, I am stumped on how to format that line of code? Do I need sometime of variable? I tried to use the address/lookup code but it does not work.
I have excel 2013.
Is it possible to effect one cell by the condition of another cell. For example cell A1 turns blue when cell C4 meets a certain condition.
The 1st sheet my users see after install requires a little patience. he/she has to put mandatory information into certain cells. I would like to blank out the rest of the sheet (formatting and all) until this information is supplied. So that the necessary initial requirements stand out alone.
This is a budget package. The user has to initially supply - weekly wage - start date, Account names, estimate amounts that will be spent on each account per week, before the program can work
I do supply instructions - but hey! who reads them? They get refered to perhaps after the 1st stuff up.
A form may work - but the sheets are already laid out with spaces in the wrong places for forms (so the Form Wizard seems to indicate) - beside the fact that I wouldn't have a clue how to make a form
I would like to produce a carousel effect. i will start with a basic example and then explain the complications.
Basically I have a range of cells of indeterminant length. The left column is numbered vertically - let's say 1,2,3,4,5,6. I would like to be able to generate a carousel effect so that if I right click on a number all the cells below move down and the number at the bottom fills the gap so that if I right click on 1 the cells would become 6,1,2,3,4,5 or if I right click on 3 the cells would become 1,2,6,3,4,5.
The complication is that there will be more than one of each number eg 1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,6,6,6,6. (there will allways be the same number of each) so I would want the whole block to move down and the ones at the bottom to come up and fill the gap.
The other slight complication is that the range of cells is 5 columns wide so I would want the whole block of cells to carousel.
I have added a shape to my spreadsheet to work as a button. All is fine and it has the desired functionality however, adding the actual effect or simulate the effect of a button click/pressed?
View 14 Replies View RelatedExample number 1:
You invested 10.000 Dollar in the year 1985 into a tempelton fund and waited 20 years. Result can be seen at many forums and stock plattforms
Example number 2:
In 1985 you had no 10.000 Dollar, but only 100 Dollar a month. You invested this 100 Dollar each month for 20 years.
How big will the difference be between example 1 and 2 ?
*** Background.
If a "share" will cost 100 Dollar, you will get 1 share for 100 Dollar. Next month share is down to 50 Dollar, you will get 2 shares for your monthly 100 Dollar. Next month share is up at 200 Dollar, you will get only a half share for your 100 Dollar. Its called cost average effect.
Tool should allow "play arround", to simulate various scenarios, talking into account growth rate, time period, monthly investment, fluctuation of a theoretical share. Idealy we would love to " import" e.g. famous fund history (eg. Tempelton, Pioneer) etc. to see how investment would have developed when a steady monthly payment would have been made.
I Need a macro which has to get left() value based on the value from Column "o"
(ie)
If Column "O2".value = 17 then =LEFT(A,4)
Else
if Column "O2".value=18 then LEFT(A,5)
Else
if Column "O2".value=19 then LEFT(A,6)
Else
if Column "O2".value=20 then LEFT(A,7)
Like this i need to check more than 20,000 rows in one sheet like this 10 sheets/
I am trying to write code that will run a macro based on values in a certain column. I do not know how many rows are present at the time the macro will be run.
For example, if Column A has the number 2 in every row then I want macro Z to run. However, if the values are not the same then I want macro Y to run.
I am making an excel sheet which can track the hypothetical effect building an order has on current inventory. The user is to change the quantities in this hypothetical order whenever they want.
It is composed of two sheets, the inventory sheet and the model sheet. The inventory sheet has the costs of every part carried and how many are currently in stock. The model sheet has a breakdown of what parts are required to build the different models.
I am looking for a function or VBA which can take a hypothetical order (build xx of model one + build xx of model two + build xx of model three), see how many total parts are needed, then calculate and display the effect it has on current inventory. This is only to see the hypothetical effect on inventory, not to actually change the inventory in the inventory sheet.
I've attached what I have so far - most everything is completed except for this final calculation. I have tried using the VLOOKUP function in VBA to try and come up with a solution but I couldn't figure out the best way to go about this. I think the hardest part might be that a hypothetical order can be made up of all three models.
I have set up a spread sheet which uses tick boxes and I have calculated it all up so that the percentage of ticks ticked is displayed in a cell etc. and when I link that data to a bar chart it works perfectly. .e.g as I tick the boxes the bar chart increases
BUT when I try to do the exact same thing with a pie chart it doesn't work.
I am trying to make a spreadsheet that contains numbers in columns D to P. My end user wants to be able to adjust these with scroll bars so I could make ActiveX scroll bars under each number in each column but this would be a lot of scroll bars (one in each row and columns)!!!!
Is there are way where I have have scroll bars in column D to P that only effect the active rows and always sits below the active row?
I want to gradually change th colour in a block of cells. my plan is to use code to sequentially fade through ten or so shades from light to dark. is there a way to slow the code down so that it takes a couple of seconds to run the sequence?
View 2 Replies View RelatedI created a couple of piviot tables from the same sheet I had VB code in. Since the creation of these P tables the code has stopped functioning.
In a attempt to re-activate the code i moved the piviots to a new spreadsheet. But the code is still not working....
I would like to freeze the bottom part of my spreadsheet, such that the user can scroll through the upper part but still be able to see the bottom part. The freeze command freezes what is above the line, I want to freeze what is below the line.
View 4 Replies View Relatedi need to group the values based on A, B, C columns.
which means all "Chickpea_B-1_11area_3d.csv " will have same timestamp and mean_area_3d values, only D column vlaue changes.....
in the same way, all "Chickpea_B-1_12area_3d.csv" will have same timestamp and mean_area_3d values, only D column vlaue changes.....
now i need all Chickpea_B-1_11area_3d.csv values to be grouped into one. and chickpea_B-1_12area_3d.csv values to be grouped into one..
if you see the output sheet, you will understand clearly, which i did manually for your easy understanding...
i did manually and also attached the sheet for your kind reference and easy understanding... where i grouped all Chickpea_B-1_11_area_3daver_domain_area, fill_factor, leaf_angle_theta, plantHeight, projected_leaf_a into one.... where b and c cols are same for all the D E F G H I Values. in the same way for Chickpea_B-1_12_area_3d and all other below values to be grouped.
like this i have to do for 1000 files. please find the attachment...
I need a macro that duplicates lines based on the value of a Column. So in Attached excel D1 is 10 - I need it to create 9 entries for that line, so there are 10 total duplicate lines.
I had a Macro that worked that is in the document, I even had everything set up the same, which it is not now, but could not get it to work.
A Macro or a Finished document is fine, Just need this to produce raffle tickets for the church
Raffle Tickets.xls
I have a spreadsheet with month names in column A10 and down and want to highlight the row based off a cell(which will be A3) so if cell A3 = Nov it would highlight all rows that have Nov in column A. I don't want to highlight the entire row just columns A.
View 5 Replies View RelatedCeating a macro to perform a look up and return based on column headers.
General Synopsis: Using a call and parameters to choose a lookup column and return column, and their respective sheets. Then the sub routine finding their respective column headers and perform a lookup/return. Essentially the current problem is the macro runs to slowly.
Link to original post: Lookup Macro based on column headers
I have read several related threads and tried to adapt their answers to my application with no success. I am trying to write a macro that will hide rows based on that row's value in a certain column. Specifically, column AB contains sums and if a sum equals 0 I want to hide that row. The sums start at AB5 and go to AB118 but there are 4 gaps in the column at rows 25, 47, 70, and 94.
View 9 Replies View RelatedI have a Worksheet were I have a formula in cells from D5 to ALO5. That read "Hide" or "Unhide".
I would like the column to each hide individually hide if that column has "Hide" in in it. If it has "Unhide" in the column then it becomes visible again. The range of the columns match the formula cells which are "D" through "ALO".
Basically I need a formula that takes into effect many variables. It needs to check a size, thickness, and material, to determine a cost...
1.5 O.D. - 16GA - 304SS = $X
but
1.5 O.D. - 18 GA - 304SS = $Y
and such.
The problem I have is not only am I not understanding a lot of Excel jargon, the data set is not in perfect "example" conditions.
O.D. is in N:N yet there are blanks between N(x) and N(y), GA is in O:O yet blanks between O(a) and O(b), and so on.
Here is what I have at the moment, it uses a second sheet to derive the cost based on the parameters. Please ignore the first few terms, they are used with this cost lookup to give me my final. There also may be incorrect syntax in this, but since I get a nesting error first, I really don't know.
=V7+(Q7*M7*(IF(N7=2=AND(O7=20)=AND(L7=304),’Steel Tube Cost WIP’!$DD$19,IF(N7=2=AND(O7=20)=AND(L7=316),’SteelTubeCostWIP’!$DD$20,IF(N7=2=AND(O7=20)=AND(L7=2205),
’SteelTubeCostWIP’!$DD$21,IF(N7=2=AND(O7=18)=AND(L7=304),’Steel Tube Cost WIP’!$DD$16,IF(N7=2=AND(O7=18)=AND(L7=316),’SteelTubeCostWIP’!$DD$17,IF(N7=2=AND(O7=18)=AND(L7=2205),
’SteelTubeCostWIP’!$DD$18,IF(N7=2=AND(O7=16)=AND(L7=304),’Steel Tube Cost
[Code] ......
Mentioning LOOKUP, can I even use it? I've attempted many times however it isn't going too well What can I do?
I look at stock charts that allow an overlay of "zigzag patterns." This zigzag links price extremes with a line. The price extremes are defined according to "wave size" which is described as follows:
"Wave Size: The Most Important Setting... and the thing you will want to tinker with -- is Wave Size. Wave Size is a number that defines a high or low price extreme, by stating the number of surrounding bars on either side that must not be higher or lower than the candidate extreme. Another way to think of it is: Wave Size + 1 is the minimum distance between extremes of the same high or low type."
Here is an example of what a stock chart with these zigzags drawn in looks like. [Click on the image to zoom in and see it better.]
[URL]
The black diagonal line is built using a "wave size = 5" using the above definition. And the green one is, "wave size = 20"
I am trying to build this into a spreadsheet so I can play with the data. If I have four columns: (a:open)/(b:high)/(c:low)/(d:close) I cannot figure out how to build the columns after to do this zigzag. I understand what the line is, but it just doesn't make sense to me how to derive it from the data. how to get a column n that has the value of the zigzag (with wave size = 5 for example) I
Is there a way to fix a private sub to catch keydown effect of various combos and textboxes of my userform?
Instead of typing the same thing to each and every control's keydown event just call a sub. Code goes like:
Select Case KeyCode
Case 112
ShellExecute 0, "open", "hh.exe", ThisWorkbook.Path & "1.chm", "", 1
Case 113
If MsgBox("Backup now", vbQuestion + vbYesNo) = vbYes Then BackUp
Case 114
Col = 3
SearchD
Case 115
showexcel
Case 116
readonly
e.c.t.
Instead of that, if i place code in a private sub test() just call test in keydown event
1st - Need a macro to change a range of cells colours based on a single cell having a value greater than 0.001. ie. cells A1 - G1 need to change to grey based on cell F1 having a value greater than 0.001 entered in it?
2nd - Also a macro for deleting the text contents of cell C1 based on cell F1 having a value greater than 0.001. Therefor if cell F1 has a number greater than 0.001 it changes the colour of celss A1 - G1 and also deletes the text in cell C1?
I am looking for a Macro that will search a column for blank cells, and when one is found will add text to the same row in another column. For example: The below is a spreadsheet. I am trying to find something that will search through column "C" in this case and add text (of my choice) to Column "A" if the cell is Blank. So Since cell C1 is Blank then Type "ERROR" is cell A1.
A B C D E
1 X X X X
2 X X X X
3 X X X X X
4 X X X X
5 X X X X