Specify Cells In View After Running Macro
May 19, 2007
I've written code to create sheets and populate them with data from other sheets. Other subs then work through each row in those sheets to find data for summary sheets. I've frozen the panes on each sheet so that the header rows are always shown. The problem is that after all the code is run, the 'view' on each sheet is the bottom of the table of data (because each row has been worked through in turn) when actually I want my users to see the top row of data. I've tried selecting and activating cell A5 (top of my table) in the last few lines of code (after all the other subs have run) but neither seems to do the trick. There must be a way to specifiy which part of the sheet is visible after running code.
View 2 Replies
ADVERTISEMENT
Apr 17, 2014
Just started using Macros on Excel.
I recorded a Macro that would take a value of a particular cell and add that value to the selected cell in the same row. However, this macro just runs on one cell and I want it to run on the entire row.
This may seem like a trivial issue but I've been racking my brain for the last couple of days to figure it out.
Here is the VBA code of the Macro I recorded. It adds the cell value to another cell with formulas already in it as you will see below:
Sub SpreadingTest15()
'
' SpreadingTest15 Macro
'
'
ActiveCell.FormulaR1C1 = _
"=IF(MarRF!RC9=""Trade"",IFERROR(IF(RC12=""BL"",RC13/12,INDEX('Variable Data'!R4C2:R16C17,MATCH('1410-Rev'!RC14,'Variable Data'!R4C2:R16C2,0),MATCH('1410-Rev'!R14C,'Variable Data'!R4C2:R4C17,0))*RC13),0),IF(RC14=R14C,RC13,0))+(RC35)"
ActiveCell.Select
End Sub
View 4 Replies
View Related
Jul 26, 2006
I need to create a simple stopwatch program to store the times and write details concerning each time. I got the stopwatch to work, but everytime i try to enter a cell to write in information(while the stopwatch is counting up), the stopwatch stops counting.
Is there any way to enter data while the stopwatch/macro is running?
View 3 Replies
View Related
Feb 5, 2010
I have figured out how to write a macro to make charts for me automatically, but it only runs the macro on the exact same range every time.
I have about 100 different students to make charts for and would really like to find a way to do it more automatically
Is there a way to write a Macro so that I can run the same steps on a different range (same number of rows and columns)?
Edit: having learned from my first post, I am adding more information.
the first chart is from the data in the range from B5-H7
the next chart would be from the data in the range from B11-H13
The charts are not evenly spaced from each other. I will need to select the range (same size) each time.
I can record the Macro, I just can't apply it where ever I want to.
View 14 Replies
View Related
Feb 21, 2009
I want to be able to select a cell, for example A10, this would then run a macro that would copy and paste several cells of information along that row and paste it on another worksheet. However, if i then choose a15, a3, a79 in turn (using the control key), it would run the macro using those rows in turn.
i'm looking forward to hearing if and particuliar how this could be achieved.
View 13 Replies
View Related
Feb 10, 2009
Ive seen on someone elses workbook the first 6 columns are fixed (always in view) then you can still scroll across but those first six columns always stay in view.
View 3 Replies
View Related
Dec 27, 2006
I have some command buttons on worksheet. I want to do next: when I am click on command button1 I am see a VBa code of command button 2 How I can do this?
View 2 Replies
View Related
Jul 16, 2009
I am generating the chart from the following code but when it prints i.e (Mode#1 or 2 or 3 etc....) with type i.e. (GL_Weld or Bend or any other text). Printing as i.e. (Mode#1Bend or Mode#2GL_Weld). I would like some space in between (Mode#1 Bend) or (Mode#2 GL_Weld) or even put it in next line underneath it ( Mode#1 Bend).
How do i incorporate and space or enter next line? Code as follows:
View 3 Replies
View Related
Feb 14, 2014
When I select multiple cells horizontally at the top are highlighted columns for those cells.
I would need to know the number of those columns (es. 5), "on the fly", without having to rely on eye every time. This number maybe displayed in a status bar or other window...
View 4 Replies
View Related
Feb 21, 2014
How do you view or display data from cells that have been merged?
View 8 Replies
View Related
Feb 11, 2009
1. I can't remember it, but I know there is a command so that the view hold and that the selected tabs and cells does not show and the same view remains until the "unhold" is called in the macro. THEN the view is updated. What is this command again? Could not find it...
2. The macro needs to delete tabs at the click of a button (easy part) but for each deletion, a message appear:
Data may exist in the sheet selected for deletion. To permanently delete this data, press Delete. Is there a way to prevent the message from popping out when the macro is executed?
View 2 Replies
View Related
Dec 12, 2013
Excel 2007 - need to adjust protected view settings but the protected view tab is missing from my Trust Centre settings - have the following tabs - trusted publisher / location, add-ins, activeX, macro, message bar, external content and privacy options. Document is a revenue authority download and without being able to adjust the protected view settings, can't input data.
View 3 Replies
View Related
Jul 3, 2007
Here in our department we made a pretty elaborate macro that takes a report and sorts them out to 17 different sheets in a one workbook. This Macro pulls a file from a specific location on our server and then opens the CSV sorts it out color codes all the important information and saves it back onto the server under you specific initials.
They are four PC's along with our Managers laptop that run this Macro daily.
About 3 weeks ago my Managers laptop stops running the Macro completely and hangs in the middle of the whole thing. Eventually crashing Excel.
We try to remove the modules and re-import them back into the personal macro workbork but this does not work. The Macro's did not change and still fully function on the other four desktops to this day.
I uninstall Office on my Managers laptop and reinstall. Import the Modules again and still hangs up in very same spot it did 3 weeks ago.
I've tried to lower the macro security to the lowest level also and I've still had no luck with this laptop. I don't understand. The Macro's function perfectly on other PC's but will not function on this laptop.
View 9 Replies
View Related
Jan 7, 2009
I have a Sheet sheet1 and I want to run a macro when the cell D2 in Sheet1 is equal to 10,7,5,and 3. I only want this macro to run when those values are reached the macro then puts the data onto a sheet called wps. The macro is run as a module and is a sub macro.
View 9 Replies
View Related
Dec 19, 2006
Can i run a macro by just the pointer going over it.
View 9 Replies
View Related
Apr 10, 2014
I'm trying to get a macro to run when the user presses the save button. I have the following code:
[Code] .......
This code is supposed to apply the TRIM function to every worksheet in the workbook when the user presses save, and the saves the results. I understand the Private Sub bit is the code to have the macro run during the save, but for some reason the macro itself isn't actually running. I'm not getting any error message, its just that the cells which should have the TRIM function applied to them aren't being corrected.
View 4 Replies
View Related
Mar 10, 2014
I have a macro that takes about a minute to run. I would like to add a progress bar to appear once the macro starts running. There are no loops in the macro. What are my options?
View 3 Replies
View Related
Mar 17, 2014
I have 3 different sheets with a private sub on each all labelled
Private Sub CommandButton1_Click()
The macro's runs fine on each page.
I want to put a macro on a separate sheet that i can run each of those macro's
I did initially copy the original private macro and change the
Private Sub CommandButton1_Click()
to
sub report()
But I couldn't do all 3 in the same manner. i did change each name to something different... the other 2 subs did run, but they didn't do anything except put the massage box on the end saying that "the macro has finished".
The private macros are on sheets 26, 28 and 12.
View 3 Replies
View Related
Mar 25, 2014
I have 7 different workbooks as part of my daily routine.
At present the first workbook is opened via the task scheduler, and the macro is run using the following code
[Code] .....
This then opens the next workbook and closes the current one. The next workbook then runs its macro again from a timed call
[Code] ...........
This repeats for 7 workbooks. The problem is, if a macro overruns - the whole schedule is out of sync when macro's are called depending on the time. What I would like to do, is link each macro by calling for the next one, and closing the current workbook. However, when i have tried to do this, the macro has always stopped when the workbook has been closed - the next macro doesn't run.
View 2 Replies
View Related
Oct 3, 2007
Below is the entire code that I am using. It is a simple routine which checks whether a part has started its release process or not, based upon dates. The code works and does what I want.
The problem that I have is that it is very slow, for example it takes 35 seconds to go through 530 lines items. In my (limeted) experiance, based on other VBA doodlings this slow.
View 9 Replies
View Related
Jul 28, 2008
Is it possible to run a macro from an IF command?
View 9 Replies
View Related
Oct 8, 2008
I already have a macro made named (PowerPoint) that is saved to the wookbook. I am looking for a way to have this run every 20min. I have tried several differnt things and it did not work. Here is one I found online. I only need it to run when it is open and every 20mins. as long as I have it open.
View 3 Replies
View Related
Dec 18, 2008
I have 2 workbooks (Workbook1 and Workbook2).
Workbook 1 contains a button, that calls a macro. This macro calls a macro from Workbook 2.
For this, I am using the Application.Run function.
The Macro in Workbook2 is a simple one line macro that updates cell A2 to a value of 6.
Range("A2").Value = 6
This works fine!
However, I want the the cell A2 in WORKBOOK1 to change to 6, not the cell in Workbook 2.
To add an element of difficulty, Workbook 1 could have any name (I won't know what it is, as the user could change it).
How can I get the Macro in Workbook 2 (Called from Workbook1), to update the cells in Workbook 1.
View 12 Replies
View Related
Jan 11, 2009
I have a problem with a macro in Excel 2007. It invokes
solver and creates an answer report. Please find the VB
code for macro, below.
View 7 Replies
View Related
Apr 8, 2009
How do I ask for a confirmation box before running a macro, but only one time. What I mean is some of the macros I use loop and it wouldn't be practical to click on "ok" for each time the macro ran.
So again I just need some code to tack on to the beginning of a couple of my macros that will ask me before they run but only once.
View 11 Replies
View Related
Jun 11, 2009
I have the following macro in a worksheet...and it is running very slow. There are other macros in the worksheet and they all run very well. Any ideas by looking at this code why it would be so slow in running?
View 7 Replies
View Related
Aug 10, 2009
I have a spreadsheet containing a macro to automatically sum values from week to week and display the max/min and average. This is almost fully working. The problem I have is the macro copies the sum formula down the page and doesn't stop at the last row. It always adds one or two extra rows. The formula should stop at row 77 however this does not happen and therefore the sum keeps going. Which in turn, distorts the max/min figures.
View 2 Replies
View Related
Sep 17, 2009
I have 2 files in a folder, "Main.xls" and "My Database.xls". "My Database.xls" contains the following macro in 'Module1':
View 2 Replies
View Related
Jul 23, 2014
I am trying to utilise a vba script for DNS resolution which i got from Followup: DNS Lookup and Ping in Excel - CodeProject
I have a list of IP addresses that I want to use this on, however if I test this by using the test instructions, excel does nothing, its just text in a cell, so I would like to know how would this procedure get called from the spreadsheet?
Code:
GetHostname("4.2.2.1") in any Excel cell.
or
Use: GetIpAddress("www.google.com") in any Excel cell.
View 3 Replies
View Related
Jan 12, 2007
I am trying to achieve an automated macro.
I would like my spreasheet to look at cell B2, compare this to a list of information in Sheet2 and if it matches, run Macro1
View 9 Replies
View Related