I don't know if I am asking for something impossible,but is it possible to create a MACRO to automatically add or subtract 10 to whatever number is in the cell? for example:
A1= 20
I would like to have a macro that lets you either add 10 to it to become 30 or subtract 10 to it to become 10.
I have a macro that increase a cell number and one that decreases a cell number, heres my code:
Code: Sub Macro1() Dim t t = Split(Worksheets("Sheet1").Range("d5").Text, "/") t(0) = Format(t(0) + 1, "0") Worksheets("Sheet1").Range("d5") = Join(t, "/")
[Code] .......
So they do exactly what i want them to do but i want to put a limitation on them, so say the number in the cell is 0 then i dont want it to be able to subtract from it anymore, and say the number is 20 i dont want it to be able to add any more, i tried to put if statments into the code but no luck.
i'm looking for a loop macro to perform the following task:
Sheet 2 is my look up table, and sheet 1 as a number of references such as: ='Sheet 2'!B1 ='Sheet 2'!E1 ='Sheet 2'!G1 etc
I need a macro that increases the row references "1" to "2", saves the sheet then increases "2" to "3" and so on until the bottom of the reference table is reached
I am attempting to use a cell reference generated using the "address" function and text function (so the cell displays text only, not formula) as a means of defining the top left cell into which I want to paste a column of formulas. The reference cell is static, but the contents is dynamic.
I have a drop down list made from the Forms toolbar with a list of items: 1, 2, 3, 4, 5. I have set it with a linked cell, so when you choose, say 3, from the dropdown, 3 appears in B10.
I was hoping to add a 'Go' button, which would run another macro depending on what is in B10, i.e. so if 3 was chosen, then you press 'Go', Macro3 would be run.
So I have 5 macros called Macro1 - Macro5, and I need some code for the 'Go' button which will run the right macro depending on what number is in cell B10.
I use this to read cell content, add some text/characters (ie. [ and ]) and change the properties of the complete cell
Sub COMMENT() Worksheets("DVD Lijssie").Activate If ActiveCell.Value 0 Then ' Change all in to ... ... ... ActiveCell.FormulaR1C1 = ActiveCell.Value & " " & "]" & " " & "[" With ActiveCell.Font .Name = "Arial Narrow" .Size = 8 .ColorIndex = 16 End With End If End Sub HOW can I change this vba-code so it leave's the content of the cell like it is and add some content with the use of let's say TexBox1 and ONLY use different font properties for the newely added content?
I am having some trouble writing a macro to delete cell content. I know which cells I want to clear, but I can't seem to get the macro to do it.
I also want to have something in the macro that inserts data into the lines that I am trying to clear. I want cell A67 to say "Payment" and cell A71 to say "Total."This is the code I am using: Sub DeleteCell() Dim i As Integer For i = 67 To 71 If Range("A" & i).Value = "--" Then Range("A" & i).Delete Next i End Sub
I'm only starting to get into the Macro side of excel, and I've created a couple of macros to automatically format cell contents and the like. However I'm having trouble trying to divide some cell contents by 100.
I have 2 files I'm working with, one contains information regarding cd's and percentages, however the percentages in this file cannot be formatted to percentages (so the powers that be say) for whatever reason. I copy all this information into another file which does have the percentages formatted as percentages, the result is that the values get multiplied by 100.
So values that read: 100 50 50.25
for example, appear on the new sheet as: 10000% 50000% 5025%
Is it possible to write a macro that will divide these percentages by 100 so the read correctly as: 100% 50% 50.25%
Is it possible to create a macro attached to a button that allows me to save the workbook based on content of 2 cells in the workbook?
I like to save the workbook based on content of cell A4 that contend a text string. After that saving another time with the contend of cell A4 plus cell A9 which contend the today() function. I am doing this because this workbook is constantly updated and a backup copy is done based on the date the file is save.
Formula/macro/etc that would enable me to have content of a cell changed based on the content of another cell in the same row.
Example: cell in column D says "PSA" - so I would need the cell in column H for that same row to read "Radio"
I would need an entire sheet scanned to review for these occurrences and make the appropriate changes. I also would need the formula to be inclusive enough to scan for variations in column D cell content (PSA 1, PSA 2, etc).
I have a test due in the morning, and I really need this question answered ASAP, if anyone could. I need to create an IF formula for this situation: the standard Mhz is 500. Give 55.00 for that standard. But for every increase of of Mhz, give 25.00 per 100 increase.
For a table like the one below produced for the sake of example (actual is much much bigger) I want to make it list rows that are true for a certain column for a certain variable in the matrix. So for say water terrain, which types of activity can I do i.e. swimming. Or for Offroad the activites which I can't do i.e. Run and Swim.
ActivityWaterRoadOffroad Jog nym Run nyn Walk nyy Swim ynn y=yes n=no m=maybe
what i need is a macro to run when I print a form. I am making a job card with a unique number on it ie: 100. when I print the form, I then need the 100 to change to 101 and so on. I cant work this one out.
EDIT - Ive attached my work in progress. It is for a computer repair shop. I have a few macros in there as I need to email a copy of the workbook too.
when you open the workbook, you will see the job number in red. I just need a macro tht will increase that number +1 every time it runs. I also need the email macro to rename the workbook to the customer name input in cell B4 - but I think im best to post this request in a new thread?
I am trying to write a program that needs to select a different cell everytime it is ran. For example, this month when it runs I need it to select cell BL137. Next time it is ran it will need to select cell BL138. Month after BL139. The cell it selects will always be in the same column (column BL) and the cell number always increases by the same amount (1).
I am in need of a macro which would be capable of doing the following;
Replacing a sequence of number's & decimals such as 58.6073.1 with 58607310000 Essentially, the code will just need to remove the two decimal points & to suffix those 4 zeros onto the end of the number sequence.
Column 'A' in my spreadsheet has cells with a number in and blank cells in no particular order. What I need to do is insert a new row above each number but I don't know how to write this as a macro.
i have a workbook containing two sheets "Impiorted Data" which is the data which is downloaded and the range will change each time the data is imported and "Pivot Table"
I would like a macro to increase the range of the data from col A to the lasst row in Col K so that the pivot Table has the correct range
I have recorded a macro , but would like this to be streamliined with regard to the range
if it is possible to increase one cell by 1 when the date was changed in another cell. I installed the code that was given to me and it worked perfectly, thanks agin JB and royuk, UNTIL the cell that was to increase by 1 was locked and the sheet protected.
I need to increase the cell value on a spreadshhet that contains over 50,000 cells. I know how to do this on a cell by cell basis. I need to know if there is some way of doing this to multiple cells. Here is my example;
$603 $712 $649
I need to increase each cell value and roundup to the next number. I have been doing the following formula: =ROUNDUP(603/.97,0) to increase the cell value to $622.
If a cell is not blank, then increase that amount by a percentage identified in another cell and display the value only without any formalas in a new cell. To this end I wrote this IF statement:
=IF(I2>0,CP9=(CA9*I2/100)+CA9,CP9="")
Observation: I see a FALSE in CS9 where this IF statement exists, however, CP9 does not display the required value.
Is it possible to have a cell increased by 1 and another decreasing by 1 in a simple cell formula.
E.g.: I have an inventory stock sheet that is very simple. I have a maximum stock column C, a stock on hand (available) column A and a stock sold column B.
Every time I sell an item and punch it into column B it should automatically decrease the amount in column A by the number that I punch into B.
I am not concerned about the maximum stock column but would like an easy formula just to work out the amount that I have available so I know when to order more stock.
So when I punch in a 5 on B2 it should decrease the value of A2 to 1. And when I purchase stock again and I punch in say a 5 on A2 it should decrease B2 to a 1.
How can I get one cell to increase by 1 after I change the date in another cell. The spreadsheet is used to keep track of Oxygen Bottles at the local Fire Dept. and I want the " Times Filled" cell to increase by 1 after the " Date Filled" cell is changed. I'm not sure if they key the date in or if they use a calender add-in pop up.
My macro works fine but I'm interested in seeing if I can speed it up. What I'm doing is starting at the bottom and comparing it with the row above and if they match in font color it will fill the top with orange and delete the bottom. This works but usually takes several minutes.
Public Sub ADMINCompareList() Dim varTest1, varTest2 Dim lng As Long, i As Integer, iTest As Integer Application. ScreenUpdating = False Worksheets("ADMIN").Activate For lng = ActiveSheet.UsedRange.Rows.Count To 2 Step -1 If Not Range("M" & lng).Font.Color <> Range("M" & lng - 1).Font.Color Then Goto newrow End If varTest1 = Intersect(Range("J:W"), Rows(lng)) varTest2 = Intersect(Range("J:W"), Rows(lng - 1)) For i = 1 To 14....................................