Using The Same Macro At Various Cells

Jan 19, 2007

I have a list of names and have created a macro to be started after I click on the name I want then run the macro.

I want to use the same macro for any of the names by clicking on the name then running the macro. Obviously the way it is now, when I click on a different name and run the macro, it runs the macro only for the name it was created.

Is there a way to do this without creating a macro for each name?

View 9 Replies


ADVERTISEMENT

How To Make Macro To Lock Certain Cells Connected To Another Cells Value Then Copy Daily

Mar 29, 2014

am making Excel for private use, i need the following makro to be active, here is the idea because i didnt yet work with makros at all:

If A1 = False
then Range B1:D1 will be locked cells

If A1 = True
then Range B1:D1 will be unlocked cells

Those rules apply to 1 day in the year.

the range A1:D1 will be copied about 400 so the makro should be active to each day separatly.

Check the picture attached for example of one day

View 1 Replies View Related

Macro Paste- Macro To Get The Values From Cells D29 And H24 In The Resource Calculator Sheet

Sep 17, 2009

I need a macro to get the values from cells D29 and H24 in the Resource Calculator sheet and populate it into cells N8 and O8 in the Input form.

Users will then be able to change the information in the calculator and click the macro again to populate N9 and O9 and so on.

Is there a way to do this?

I've attached the file for you to see.

View 13 Replies View Related

If Statement In Macro: Macro To Change A Range Of Cells Colours Based On A Single Cell?

Mar 16, 2007

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?

View 2 Replies View Related

Macro To Combine Cells In A Row To 1 Cell While Skipping Blank Cells

Jul 2, 2014

I need to combined all non blank cells in a given row into 1 cell. But within each row i have 5 phases that the values fall into, which is denoted by the 1st charter 1, 2, 3, 4, or 5. for example, in a given row i have 1-a, 1-c, 2-d, and 1-f and these values occurs in non consecutive columns starting from G to ALR. I need a macro that sorts these values in one of the 5 phases. So in another sheet the macro would combined [1-a 1-c 1-f] in Phase 1 and [2-d] in phase 2. and if there are other phases it would put them in the appropriate cell.

See attached workbook : Work Order Summary Sheet.xlsx‎

View 3 Replies View Related

Macro To Combine Cells In Row To 1 Cell While Skipping Blank Cells

Jul 17, 2014

However, in addition to what the macro already does, it is possible to add another work sheet in the same work book that outputs the values in separate cells? It also has to output the data in order: for example, in the first work sheet the data is inputted at random and has spaces but the macro will have to remove all the blank cells and output them in order based on the first value in the test string, 1, 2, 3, 4, and then 5;

input:

blank 3-x Blank 1-y blank 2-z 1-k

output:

1-k 1-x 2-z 3-y

View 4 Replies View Related

Delay Macro (Put In A Statement Within A Macro That Populates Cells With The Values)

Jan 11, 2010

Put in a statement within a Macro that populates cells with the values that I want it to but instead of populating all at the same time, is it possible for the values to be delayed.

I have designed a mock spreadsheet (attached) it has two columns 'Before' and 'After'

After = Before values (in this mock)

When you press the button, the values are populated straight into the 'After column' can we add the delay between the values? So that the values dont come up straight away.

View 3 Replies View Related

Macro To Clear Certain Cells In Row If First Cells Date Is In The Past

Apr 9, 2014

I would like to run a macro that would check if the date in the first cell of row is in the past.

If yes, then it would clear contents of cell in B,C,F,I,L of the same row (PLAN + SHIFTS). Or even better it would set them to 0 (zero).

Then it would hide the entire row. Is this even possible?

Please see the example: Excel.JPG

View 8 Replies View Related

Macro To Clear Cells With Numbers But Not Cells With Formulas

Jan 22, 2013

Macro to clear cells with numbers but no cells with formulas with in this macro:

Dim i As Long
i = Range("E3")
If i > 0 Then
' Copy range
Range(Cells(6, 10 + i), Cells(500, 17)).Copy
Range(Cells(6, 10), Cells(500, 17)).Select
' Paste special
ActiveSheet.PasteSpecial Format:=2, Link:=1, _
DisplayAsIcon:=False, IconFileName:=False
' Clear i columns on the right
Range(Cells(6, 18 - i), Cells(500, 17)).ClearContents
End If
End Sub

The range is where the cells with numbers need to be cleared but not the ones with formulas.

View 2 Replies View Related

Macro To Return Data Of Cells Based On Other Cells

Apr 23, 2014

I have a worksheet that I want to populate with specific data from another worksheet.

If all of the following are met:

1) Column A equals "763" and

2) Column K is formatted Red (255, 0, 0) from conditional formatting

3) Column P is blank

Then in my blank worksheet I need to display the data from Columns A, B, D, K, O

View 4 Replies View Related

Sum Of Cells Of A Row Using Macro

Mar 13, 2009

i need to implement this formula in a macro for all the rows in the worksheet.
E11=INT(SUM(DJ9:ER9)/(3*20*15)*100)
this formula is to find the sum of all numbers from DJ9 to ER9 and then multiply and divide by integers...
how do i put this formula in a loop so that it finds the sum of all numbers tilll row number 50?

View 9 Replies View Related

VBA Macro (Changing Cells From A1-C3 Then A2-C2)

Aug 7, 2014

What my code needs to do: It needs to verify data in column rows say for this example columns A to C and infinite rows. It needs to verify the data in this order A1, B1, C1, A2, B2, C3 etc. (One of the part I have problems to do) It also needs to add to a row/cell "1" when certain conditions. (In the same line as the last checked data in the column "D" say for exemple last data that was checked is "A3" well the 1 must be written in "D3". The conditions are simple the first Data the macro encounters must be higher than 0.25 and all following data must be higher than 6, whenever the next data is lower than 6 or empty add 1 to the corresponding D row and restart at the 0.25 cell "checking".

View 2 Replies View Related

Calender Macro In A 5 Different Cells Or More

Jun 8, 2008

The current code which I did can only pop up a caledar when I click on cell D4. Is there a way I can program it such that, if I click on D5-D7 and E4 - E7, the same calendar will pop out also?

Also, there bug which I found in this code, that if I click on D4 once, the calendar will appear. After I select the date, the calendar dissppear. The bug will occur when i try to click on D4 again, the calendar will not pop up. it will only appear after i click on any other cell, then back to D4.

View 10 Replies View Related

Finding Cells In A Macro

Sep 16, 2008

I have a row of cells with names. Alex, John, Martha, Jim, etc.
Each person has a list of data under them. I have a master column of data. Depending who is on duty today, I want the macro to find the person and then copy paste special the master column over the person column.

Thus, in the macro code where it says


Find(What:="John",

I want it to refer to a specific cell. I.e. what:=$E$4.

Then it must go to the cell it found and copy paste the info in.

View 14 Replies View Related

Macro Refresh To Different Cells

Nov 27, 2008

I've recently got into using excel for more complicated work but still have a less than basic knowledge as I'm attempting to teach myself through trial and error. What I'm currently working on is a simple macro that downloads data from a website (which I've done) but ideally I'd like to have this macro recreate the data roughly every 30 seconds/minute and also have this data recorded next to the existing data rather than on top of it. I realise that you can import data from the web using the standard tools and can set it to reset every 60 seconds but I don't think you can get it to reload the data next to it which is why I was considering a macro.

View 10 Replies View Related

Duplicate A Macro To Different Cells

Jan 15, 2009

I have a worksheet change event that prevents a person from entering a positive number in 2 different cells. If they enter a number in one cell, the other locks, and vice versa. The code is below.

View 4 Replies View Related

Run Macro To Select Cells With Value =1

Mar 2, 2009

I have a need and thanks in advance to everyone who can help me with this: Run a macro to copy from cell B2 in worksheet2, then paste that into every cell that has the value = 1 in worksheet1.Range("B2:Z40"). Cells in range B2:Z40 will be updated each week with the value varied from 1 to 10.

View 5 Replies View Related

Drag A Macro Across Cells

Jun 24, 2009

is there any way where instead of selecting a cell one by one and run a macro, i can just drag the cell with the macro across other cells like how a formula runs?

View 5 Replies View Related

Locking Cells Out With Macro

Sep 23, 2009

I'm trying to set up a macro that locks or unlocks a column depending on what is put in the column before it.

at the moment i've got the code written in the worksheet

View 2 Replies View Related

Copying Cells With A Macro

Oct 10, 2009

I would like to copy a range of cells with a marcro, for example copying range C3:C15 over to D3:D15 and when I run the macro again I want range D3:D15 to copy to E3:E15 and from there to copy E3:E15 to F3:F15. I want to keep that going to the next and the next with the same macro. But it just keeps copying the the original range which I recorded in the macro, but I want it to keep going. If somebody can help me with that, I would sure appreciate hearing from you.

View 8 Replies View Related

Macro To Count Cells With A Value

Oct 14, 2009

I'm trying to make a macro that will count the total number of cells with a value and put the result under that column and then go to the next column and repeat the proces.

View 11 Replies View Related

Formatting Cells In VBA Macro?

Jan 6, 2012

I have an array which includes an if state as such:

for j = 0 to 5
for i = 0 to 10
if menu.value = "Class 1" then
Worksheets(currentsheet).Cells(startrow + j, startcolumn + i).Value = Class1_Schedule(j, i)
elseif menu.value = "Class 2" then
Worksheets(currentsheet).Cells(startrow + j, startcolumn + i).Value = Class2_Schedule(j, i)
else
Worksheets(currentsheet).Cells(startrow + j, startcolumn + i).Value = NightClass_Schedule(j, i)
next i
next j

I want to write some sort of formatting code within this forloop to say
if menu.value = "Class 1" then
position (j,1) = a number to 0 decimal places and position (j,2) has data validation lists.

I know how to use the record macro button but I dont want to code for fixed cells. I would like to use the forloop to do it.

View 2 Replies View Related

If / Then For A Range Of Cells Within Macro

Apr 10, 2012

I am trying to create a macro such that in a given column (AB 0 -100), if the cell entry is "1", then another cell in the same row will be copied (C) and pasted to a third column (F).

All of the entries in column AB are 0 or 1.

So, for example, if AB23 = 1, the contents of C23 are copied, and pasted in to F23.

If AB24 = 0, nothing happens.

Code:

Dim i As Integer
For i = 1 To 100
If Range("AB" & i).Value = 1 Then
Range("C" & i).Select
Selection.Copy

[Code] ...........

View 6 Replies View Related

Macro To Format Cells Only Once

Jul 5, 2012

I have a spreadsheet that uses a macro to format it. It’s quite simple and the code is shown below:

Code:
Range("A1:D2").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic

[Code] ...........

The spreadsheet will have info constantly added on (downloaded from a CSV).

What I would like the spreadsheet to do is look at the cells and only format those that have data in them but are not already formatted – otherwise I’ll just end up re-formatting everything every time and as the spreadsheet gets bigger it'll take longer and longer.

View 6 Replies View Related

Macro To Merge Cells

Feb 7, 2013

I have a range of data, that I need to setup a smart macro for, but I need the macro to do the following:

Merge Rows if Column G is the same, merge shall be done in Column A, C, D, E, F, G, H, I, J, K, L, M, N, S, T, U, V, W, X, YNo Merge: Column B and O, P, Q, RMake SUM in Column L, M, N for column O, P, Q. The macro to run for the entire sheet, until first empty cell in column G

A
B
C
D
E
F
G

[Code]....

I have tried with a Pivot, but it doesn't work out, as I need to be able to make changes to all cells after the "merged" cells has been done.

View 9 Replies View Related

Macro That Uses (Does Not Contain) To Autofilter OUT Cells Value

May 23, 2014

I know how to filter based on cell value, and how to auto filter "does not contain", but is it possible to combine these? i.e. Filter OUT the value of a cell from a range?

View 3 Replies View Related

Macro To Clear Cells

Nov 30, 2006

I have data in columns a,b,c and d from row 1 to about 200 right now. Every week another 9 rows are added. I wanted to create a macro that will delete the last 9 entries in each column.

View 9 Replies View Related

MACRO Comparing Cells ...

Dec 21, 2006

I have a Workbook with two Sheets MAIN and STATS

Col A in both sheets contain text values (names)

I need a macro which will:-

Look at each name in Col A MAIN sheet.

See if there is a match in Col A of STATS sheet.

If there is a match then enter "YES" in Col E

e.g Smith Eddie is is in the Cell A20 MAIN sheet, Smith Eddie is in Cell A55 STATS sheet, so Enter "YES" in Cell E55 STATS sheet.

View 9 Replies View Related

Macro For Matching Up Cells

Mar 14, 2007

I am struggling with a macro that I’m trying to create. Basically what it would do is it would start at cell K1 on a sheet called “Database” and look for the value contained in cell K1 in the entire sheet.

It would paste all matches until no more are found into a sheet called “Matches”. Cell K1 would also be moved to this sheet if matches were found against it. It would then move on to the next non-empty cell in column K.

If no matches were found it would move on to the next non-empty cell.

View 9 Replies View Related

Macro's Starting From Different Cells

Nov 19, 2007

I want to build a Macro that basically moves right of the cell I am in a few cells and then copies and pastes this info into another worksheet and then prints this worksheet.

However, I can't seem to build a macro that will run from whatever cell I am in.

Everytime and try it just goes from the cell I was in when I recorded the macro.

For instance, if i build the Macro in row 1, but then want to run the marco in row 23, it keeps going back to row 1 whenever I press play.

I know there must be a way of telling it "move right 5 cells from whatever cell is highlighted when the Macro is run...etc"

View 9 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved