I've a command button on one worksheet (named "Front") that when clicked it "resets" a large number of cells back to "."
I've ALSO a command button on another worksheet (named "Back") that when clicked it also "resets" a large number of cells back to "."
Both are embedded on their own VBA tabs.
Both work exactly as needed.
No problem.
Is there a way I can move the coding from both to the "This Workbook" VBA tab, leave the one command button on the "Front" worksheet, and eliminate the one on the back?
I'm kinda guessing that this will require my rewording the "(Range("C5").Formula = ".")" (example line of code for the first cell it resets on the "front" tab) to something specifically referencing the "Front" worksheet, and the same for the ones on the "Back", but I could be wrong.
I have an excel that has Marco being run by using a command button to create my pdf's. But my work sheets are Protected by a password. Is there a code for me to insert in order for the worksheet become unprotected for it to do the commands I am requesting?
I have a large data file with several different worksheets. In one cell I have a large set of individual numbers (i.e in the cell there is "123456 234234 939829") This value is my 'sample' number. The same sample could be in multiple rows on one sheet and could also be on other sheets. I am trying to find the sample in a column (on some sheets its column "Q", other sheets it could be different columns, but that column is fixed per sheet) and then copy the information on the same row in columns A & B and copy it to my target sheet. Then the next place the sample appears copy that info to the next row of my target sheet. So far I am stuck getting it to find the multiple values on one sheet. My code is below.
Code:
Sub Samplesearch() Dim sample As String Dim x As Integer Dim y As Integer Dim lr As Long Dim lsr As Long
I am trying to create a program to automate the gauging figures on oil barges, currently everything is done by hand and takes approximately 20 minutes to complete. I have the charts entered for the tanks already and have the code set so that when you click on a tank "gauge" it will enter the "volume" which corresponds to that gauge on a totals sheet. Here is where my problem is coming in
The barges are gauged at four points "before loading" "after loading" "before discharge" "after discharge"
I want to set a worksheet as the default page with four command buttons that let the user select which operation he wants to perform. before load figures. after load figures and depending on which operation they select have it enter the volumes in the appropriate cells on the totals sheet. So if someone selects "loadopen" command button I want the following code to run on my worksheets............................
I am having trouble creating a macro for an excel file I am working on. I do not have much experience writing macros, so I apologize for any confusion. I have created a simplified version of the file I am attempting to write a macro for and attached it to my post here.
At this point it would be helpful for you to open up the attached file so that you can understand my explanation.
Basically what I want the macro to do is:
1. Match up "Product" on Wksht(Input) with "Product" on Wksht(Data).
2. Copy the "Usage per ton" and "Dollars per ton" values corresponding to the given product from Wksht(Input) to Wksht(Data) for the correct month. (The user will manually enter the month, ie "August 09" into Wksht(Input) each month when he runs the macro.) ++The color fills will not exist on my finished macro. I only put them there to illustrate the values that will be copied and pasted.
I want the macro to be written with Loop commands so that it will check to be sure the product number matches with the given location for pasting the data values. I should also note I use PasteSpecial_Values because of the formulas in the cells on Wksht(Input).
Is it possible that when you press a command button, that the first thing it does is to execute the code assigned to another command button (IE in another sub).
I have a table of data with names across the top and number of weeks down the left. The table lists amounts of money those names earned during the respective weeks. It looks something like this:
Mike Dan Bill Carl 400 500 600 700 800 900 1000 800 700 600 500 400
In a seperate worksheet within the same workbook, I have 3 columns of data. The first column is a name. The second column is a criteria. In the third column, I am trying to look up the value of 8 specified weeks of earnings of the name I put in column 1 and multiply those earnings by a percentage based on the criteria in column 2. Then sum the products.
I have a table of the 8 percentages I am trying to apply. There are 7 different percentage applications.
So if I am looking up Mike's earnings during those 8 specified weeks and the criteria in column 2 is "B", then I want to apply the appropriate column of percentages to those 8 looked up earnings, Multply them and then Add them.
Up until now, I have been trying to use some hybrid of HLOOKUP, SUMPRODUCT, and IF.
I am trying to update a project tracking sheet at work and I am having trouble. I have a list of construction projects (approx 130) along with details on the project, one detail being % completed. I am trying to create a summary of the projects at the bottom of the page, showing the total value of all projects, according to the % completed.
<10% is ANTICIPATED = 10% is AWARDED >10% <90% is IN PROGRESS >90% is COMPLETED
I have an excel sheet where I do a simple price-discount calculation for a product. Please check the file at:
Code: [URL] ........
A2 shows the price, B2 shows the discount and C1-L1 shows the number of units sold. C2-L2 is where I want to calculate the earnings based on the formula I have in C2. I want to apply the same formula to the entire row so that I can quickly see the earning for any number of units sold.
So right now I have a formula that I'm using in column "C":
=IF(B4="","",IF(AND(B4=22),"IN RANGE","OUT OF RANGE"))
So basically column C tells you if the number in the B column in within the range of 22-30. Now I want to write the formula in column D and make it apply to columns B and C.
So cells in columns B and C will have a number value in it and I will make column D where the formula is. There will be a number in B or C, but never at the same time. I can't figure out how to alter the formula to do this.
I use the If - Then statement in VBA to determine a condition which works perfectly fine for the particular cell I reference to, but i need it to apply to all the cells i.e. cells A1:A10?
Sub MACRO1()
If Range("A1") = "PAYE" Then Range("B1").Formula = "=C2 * .128" End If
If Range("A1") = "LTD" Then Range("B1").Formula = "=(C2 - 100)* .128" End If
have a code for restricting printing until some cells are filled; however the code is been applied to all the file. I need to apply it to one one sheet. Thanks for your help.....
Private Sub Workbook_BeforePrint(Cancel As Boolean) With ActiveSheet If Application.WorksheetFunction.CountA(.Range("A11:K11"), ("A13:K13"), ("A16:K16"), ("A19:I19"), ("J18:K18"), ("A22:K22"), ("A25:K25"), ("B63:B64")) < 8 Then MsgBox "Please Complete Information" Cancel = True Else 'Allow printing End If End With End Sub
I have cell A7 Merged and need info in that cell. Example of what I want: Say I click on cell A1 and it is the color Pink, but has the letters blue in it. I would like it to display the word "Pink" in cell A7 not the number. Well I would like when you click on any cell with colors, that it will display the color in Cell A7. When I try different ways all it gives me is the number in the last cell of the square not the color and when I click on other cells it will not give me that cells info.
Private Sub CommandButton1_Click()
Dim x, rng As Range, r As Range Dim myList Dim row1 As Integer
x = Application.InputBox("Enter size of square: 2=2 by 2, 3=3 by 3, or 4=4 by 4", Type:=1) Set rng = Range("a1").Resize(x, x) myList = [{1,2,3,4,5,6,7,8;6,11,3,10,13,16,38,53;"Brown","Pink","Grey","Purple","Green","Red","Blue","Yellow"}] rng. CurrentRegion.Clear Randomize
For Each r In rng x = Int((8 * Rnd) + 1) With Application.WorksheetFunction r.Interior.ColorIndex = .HLookup(x, myList, 2, False) r.Value = .HLookup(x, myList, 3, False)
Range("A7").Value = r.Interior.ColorIndex
End With
Next
With rng .ColumnWidth = 10 .RowHeight = 50
With .Font .Size = 14 .Color = vbWhite .Bold = False End With
.HorizontalAlignment = xlCenter .VerticalAlignment = xlCenter .Borders.Weight = xlThick End With
I need to cut off addresses by 30 characters. I am doing this using the MID function. However, being a newb, how can I apply this function to say D4, D5 all the way to D899, without copy and pasting for 800 times? I did search this first, and couldn't find a resolution.
Attached is the example of the data, I am trying to sum the amount applying 2 criteria, within a particular month and other category. The formula tried is
=SUMIFS(D5:D10,C5:C10,"*June",E5:E10,H1)
However it is giving a value of zero only. I have tried other combinations as well.
I have a macro which sorts data within a cell. This is working perfectly fine but the only problem with this is that it works only for a single which is selected. How can I apply this macro to range of cells I select using a mouse.
For simplicity, let's assume I have three columns, "Company," "Policy," and "Balance."
Example: Company A Life $1 Company A Med $2 Company A Dent $3 Company A Disab $4 Company B Life $9 Company B Med $5 Company B Dent $7 Company B Disab $2
According to my post preview, the columns are running together, but I do have it arranged in three distinct columns. What I want to do is program a macro to do the following:
Every time the name of the company changes, I want Excel to insert two rows after the last of the group, and have a summation of the "Balance" column in the first inserted row.
This is what it should look like:
Company A Life $1 Company A Med $2 Company A Dent $3 Company A Disab $4 $10 <- (this should be directly under the $4, but I'm not good with forum languages)
Company B Life $9 Company B Med $5 Company B Dent $7 Company B Disab $2 $23 <- (same with this - should be directly under the $4)
In Excel we can apply different formatting styles to the "TEXT" contents of a cell while we are in edit mode. For example we can apply "BOLD" to Brown Fox and "UNDERLINE" to lazy in a string "A quick brown fox jump over a lazy dog.
But when the above string is concatenated from the contents of various cells, excel is unable to apply different formatting (as exampled above) in the concatenated cell. Although we can apply bold, underline etc by selecting the concatenated cell but it is applied to whole string and not to the selected parts of string.
Sheet1 *A1Brown2Fox3Lazy4*5A quick Brown Fox jump over a Lazy DogSpreadsheet FormulasCellFormulaA5="A quick "&A1&" "&A2&" jump over a "&A3&" Dog"
Moreover, MS Word's "mail merge" is capable to apply different formatting to different "Fields" in a single paragraph.
Is there any way so we can apply multiple formatting to the contents of a single cell which is not "Text" but result of "concatenate" in Excel, like MS Word's mail merge or as it is applied in custom format within straight brackets like [Red] etc.
I am using two separate workbooks. I am tranferring dates into a new spreadsheet to track projects dates for milestones.
The formula I am using is this: =IF('[BBBBB Dates as of 9-9-13.xlsx]Sheet1'!$CQ$4="", VLOOKUP(W54, '[BBBBB Dates as of 9-9-13.xlsx]Sheet1'!$1:$1048576, 94, FALSE), VLOOKUP(W54, '[BBBBB Dates as of 9-9-13.xlsx]Sheet1'!$1:$1048576, 95, FALSE)).
I would like the cell to turn green if the last part of the formula is true and stay clear if the first part of the formula is true.
I also need to add color beyond just that. I was attempting to apply conditional formatting but am a bit stumped. I want the green to be maintained regardless of other formatting. I would also like to apply to cells that are not color coded green:
Red - if the date is overdue Yellow - if the date is within 7 days Otherwise, leave the cell color as clear
Is this possible with conditional formatting? I am not at all proficient in VBA...
There is currently data on each sheet in my workbook. I am trying to get a macro to Copy the formatting of sheet "Statement" and paste the formatting on all other sheets in the workbook, except Sheet.actual
There is also a picture @ the top of sheet statement, that i would like copied and pasted to each sheet except sheet.actual.
Also, on all sheets except for STATEMENT & ACUTAL, i need the formula in cell C11 =vlookup(F14,cardnum,2,false) and in cell A11 = Name :