Way To Make A Macro Remember My Keystrokes

Jul 5, 2006

Is there a way to make a macro remember my keystrokes? When I record a macro
it only remembers the cell number of the box that I clicked and not how I got
there. What I would like to do is use ctrl+F to find what I'm looking for and
then use the keyboard (2 keystrokes down and 6 keystrokes to the right for
example) to arrive at a cell. However when I arrive at a cell, the macro
just uses the cell number lets say H20 and doesn't remember how I got there
from using the keyboard. What I'm trying to do is create a macro which
graphs data from several different worksheets. The problem is the data from
the different worksheets isn't the size of the data from which the macro was
created. When I run the macro on different worksheets it doesn't graph the
data from the same starting points or ending points. If I can't use a use a
macro to do this,

View 12 Replies


ADVERTISEMENT

Make Form Remember Data From Previous Entries

Feb 15, 2012

I have a form im using for one of my spreadsheets and it involves alot of data entry, many times alot of the data will be the same not like one entry after another but say the second, fifth, twelfth and fourteenth data entry's will be almost identical. Is there any way i can make the form remember previous entry's kind of like the spreadsheet does? so you start typing and it automatically shows what you typed that was similar into that column and you can hit enter and it will automatically fill that cell out for you. But instead of columns and cells these would be entry box's in a form.

View 4 Replies View Related

Pass Keystrokes To Another Program

Oct 25, 2007

Is it possible to write a VBA macro that passes keystrokes to another program? I have a spreadsheet with over 650 UPC codes for new products that have to be entered into our inventory system. I have downloaded and tried a few macro recorders that record keystrokes and mouse movements, but find them to be unreliable at best.

When I use the macro recorder to automate a task in Excel, (such as moving data from one sheet to another or importing data from a text file) I always go in after I'm done recording and add additional code to bullet-proof the macro (make sure the focus is set properly, etc.). I need to have this kind of control for this task and a macro recorder doesn't give me that (at least not these lower-end shareware programs I have been trying). I know that there are some higher-end macro recorders that include scripting that you can write and edit, but this our "slow" season business-wise and my supervisor has made it clear that he doesn't want to spend any money right now.

My task is simple (just very repetitive, which is why I don't want to spend all day sitting in front of my PC doing this):
1. Open Excel spreadsheet, go to starting data cell
2. Open 3rd party application and go to the appropriate data entry screen
3. Write a macro that does the following:
- checks to make sure the sheet is the active sheet
- copies contents of the active cell
- moves focus to other app and pastes data from active cell
- moves focus back to spreadsheet, copies the contents of the cell to the right (using ActiveCell.Offset?)
- makes other app active and pastes data
- repeat copy/paste for the next cell to right (in spreadsheet)
- press twice to save record before returning focus to the spreadsheet
- move cursor down one line, repeat entire process until active cell is blank

Is this possible to do? The third party program is not able to listed as a reference in VBA, but I didn't know if it was possible to at least pass keystrokes to it. It is actually a terminal emulator (Anzio Lite). I guess the full-blown version of the program has some scripting capabilities (from the documentation I've read), but the Lite version does not.

View 9 Replies View Related

Pause Code To Send Keystrokes

Dec 6, 2007

I have searched and not found a solution. I have a project that requires the item to be printed on two different types of paper from a printer. The only way i have found to change trays is the sendkeys option. But it looks like sendkeys cannot send, then pause, then send. ex:

' first select the correct printer
Application.ActivePrinter = "\hagenCopy Room Savin 4045 PCL6 on Ne05:"
' next set change printing options, presses ok to print
Application.SendKeys "%fp%r+{TAB}{RIGHT}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{UP}{UP}{UP}{UP}{UP}{UP}{DOWN}{DOWN}~%c3~", True
' next set change printing options to other color tray, presses ok to print
Application.SendKeys "%fp%r+{TAB}{RIGHT}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{UP}{UP}{UP}{UP}{UP}{UP}{DOWN}{DOWN}{DOWN}~%c1~", True

How would one insert a working pause inbetween the two sendkeys (a wait just waits before the beginning of the first sendkey. and then the 2 try to execute at the same time calcelling both)

View 6 Replies View Related

VBA Remember Numlock Status?

Jan 3, 2013

I posted here already but the subject deviated to somewhere else...

Basically I have this in a module to format TextBoxes:

VB:
Option Explicit
Sub TxtBx(i As Integer)
Dim uf As UserForm
For Each uf In UserForms

[Code].....

View 7 Replies View Related

How To Remember / Complete Simple Formulas In Spreadsheet

Dec 1, 2012

my query is about excel formulaes, I always get stuck with them, not sure how to complete them, as I need to keep a record of marks tally in a spreadsheet. I have been keeping marks record in the old tabulated manner.

View 1 Replies View Related

Userform TextBox - Remember Previous Entries?

Oct 25, 2012

I've have been building a UserForm for data entry into a stock demands system. One of the data entry items is a text box asking the data-inputter to complete a field containing the items drawing reference from the technical manual. The field can be quite long, and is often repeated for multiple items within the same drawing. Unfortunately, a ComboBox item would be have far to many items to make it useful, and so the TextBox item was preferred for this task.

My problem is that I need the TextBox to be able to recall/remember previous entries that have been saved to the data sheet in the workbook and the UserForm is cleared and closed down.

View 9 Replies View Related

Userform With Remember Password And User Id Option Or Check Button

Sep 12, 2009

I have userform in excel which asks user to enter user id and password. I want a to have "Remember Me" check button on my userform which will remember user details and he wouldn't have to enter user id and password again and again.

View 14 Replies View Related

Make Macro That Loops Another Macro And Changes Value In A Cell?

Mar 18, 2012

I would like to make a macro that loops another macro and changes a value in a cell, like such:

Run macro
if cell A1 = cell A2
Stop
Else set value in cell A1 -0.1
Loop

How exactly would i do that?

I have a little bit:

Sub Macro2()
Call wantedmacro
With Range("A1")
If .Cells(1, 1).Value = "A2" Then Exit Sub
Else Range("A11").Value = (A1-0.1)
Call Macro2
End Sub

View 4 Replies View Related

How To Make Macro Run Only Once

Dec 7, 2008

is it possible to put a message box in a VBA code so that the macro only runs once, else the worbook needs to reopened again for it to work. Is this the best way from preventing the macro to run again?

If i have multiple users, there is always a chance one might accidently press the command button twice.

View 9 Replies View Related

How To Make A Macro Run Just Once A Day

Apr 23, 2009

I am trying to figure out how to make a macro run just once a day -- the first time i open a workbook and then no matter how many times I open that workbook again it does not run......... I know how to get to run automatically when i open the book - just not how to keep it from running again THAT DAY.

Then the next day when i open that book again I want it to run again -- once......and so on..................

View 9 Replies View Related

How To Make Macro Run In All Worksheets

May 21, 2014

How do I make my macro tun in a loop through all sheets?

View 10 Replies View Related

Make Macro To Work On PDF?

Jul 1, 2014

I've got a PDF file that I was hoping to convert into an Excel sheet, but it doesn't look like that's possible, xince I'm working with only Adobe Reader, not Acrobat. Anyway, I need to compare 1 column of this report to another report that IS in Excel. Is there a way to have a macro compare an Excel file with a PDF??

View 2 Replies View Related

Macro That Will Make An Assortment

Apr 28, 2009

I am looking for is a macro that will search in column B for some codes,example: 0403874700197 but count only the numbers between the 5th (aka 8 ) and prelast (aka 12th number,in this case 9,),so we have the code 87470019. Then every code on column B has it's D column wich has some numbers.

So what will the macro do?Take column B,start with line no 1,take the code and search for similiar,counting only from 5th to 12th letter, in all the workbook ,after find all the similiar codes it will see their D columns,sum them to column D at the line wich it find the first code.Then take line No 2,see if the D cell is empty,pass,if not search for similiar codes in column B...and goes on.It's important to delete the numbers to D cells that already has summed!

View 4 Replies View Related

Macro - How To Make Variable

Aug 27, 2007

I have 2 worksheets - "Results" and "Historical". I am trying to record a macro that copies data from "Results" and then pastes into Historical. The data I want to copy will always be in "Results" A1:A10. When I want to update the macro (which will be weekly), I want it to copy A1:A10 and then paste into "Historical". Simple enough. Here is the problem:

Since this will be updated weekly, the first time I update I will want "Results" data copied into "Historical" A1:A10. The next time I update, I want the data copied into "Historical" B1:B10; then C1:C10, etc. Essentially I want the keep a running total of all of my prior data.

So I need the macro to be able to say something like - paste date into the first available column. If there is data in A1:A10, then paste into B, then C, D. How do I make the Macro variable?

View 9 Replies View Related

How Do I Make Macro Run Every Minute

Nov 4, 2008

I have a macro called MyMacro which I would like to run every minute starting from 08:00:00 and finish at 14:00:00.

View 9 Replies View Related

Make A Chart By Using Macro

Apr 29, 2006

I am trying to make a chart and I just used the macro recording thing to get the code. I have a variable called days.

ActiveChart.SeriesCollection(1).XValues = "='Pair Data'!R2C2:R24C2"

Instead of going to row 24 I want to go to row days+1 so I did the following:

ActiveChart.SeriesCollection(1).XValues = "='Pair Data'!R2C2:R"&days+1&"C2"

how I can fix it? It highlights the "C2" at the end and says Expected End of Statement.

View 2 Replies View Related

How To Make A Macro To Format All Cells

Jun 5, 2014

I would like to make a macro to format all my cells.

I need it to format my last digit to superscrift IF there is 4 digit after decimal point.

How to do this?

View 14 Replies View Related

Make Macro Required Password To Run?

Mar 28, 2012

I am trying make a macro required a password to run.

I found this code below but not sure how to use it. I would like to be able to run it from a command button.

Sub MPW()
Dim My Password
My Password = InputBox("Please enter password", "Password Prompt", "********")
'Hardcode password
If MyPassword = "password" Then
MsgBox "Access Granted", vbInformation, "Access"
'call macro
Exit Sub
Else

[code]...

View 3 Replies View Related

How To Make Pivot Table Using VBA Macro

Aug 19, 2012

i want to make the pivot table using vba macro. the sample workbook looks likes this [URL]...

View 1 Replies View Related

How To Make Same Macro Run On Workbooks With Different Names

Apr 15, 2013

I tried recording a macro to automate some tasks I perform every day between two workbooks. While in one I want to go get data from the other. The problem I'm having is the name of the workbooks I want to run this on changes every time I download my data into Excel. The files always start with the same name but the date gets appended to it. Is there a way to modify the macro to just work with the two books I've got open?

View 3 Replies View Related

Using Macro To Make Data Negative?

May 21, 2013

I run a MTD sales report from Access. If the "SOP Type" in Column Q, is a "4", I have to manually change the Qty and Price to negative values as that "4" denotes a Credit. My question is this...

Can I write a Macro that would be able to read the value in Column Q and, where necessary, make the values negative in the appropriate columns?

View 1 Replies View Related

Make Macro Work Conditionally?

Sep 13, 2013

I have a fairly simple macro (below). I want it to do one more thing.....not run if the filters have not been changed. I would like to prevent the error that occurs if someone tries to run it and there are no filters active.

Private Sub AutoFilter_Remove()

Sheets("Data").Select
ActiveSheet.Unprotect "password"
ActiveSheet.ShowAllData

[Code].....

View 9 Replies View Related

Shell Function To Make This Run From A VB Macro

Jul 3, 2006

I'm trying to run an application using a VB macro. The command line provided to me is "C:Program FilesWeb Scraper Plus+PkgExec.exe" -p "5A147DC7-0420-4321-9DEC-02B8D8111A78". This command line works fine from my Run menu. Now how do I write a Shell function to make this run from a VB macro?

View 4 Replies View Related

Make Macro Work In Many Rows

Jan 31, 2007

I'm having some difficulty with this one. I have found several posts on how to make a macro work through several rows, but cannot seem to figure out how to apply it to my macro.

Right now I'm having to write the macro for every line and it's a bear! Here's what I'm working with right now and it's ridiculous (I've actually got through line 51, but I'll only post a few here, for your sanity!)- there has to be a better way:

If Range("C9") = "" Then
Range("T9").Formula = "=IF(K9>I9,IF((I9-H9)>=180,180,(I9-H9)),IF((I9-H9)+(K9-J9)>=180,IF((K9-J9)>=180,0,180-(K9-J9)),(I9-H9)))"
Range("U9").Formula = "=IF(K9<I9,IF((K9-J9)>=180,180,(K9-J9)),IF((I9-H9)+(K9-J9)>=180,IF((I9-H9)>=180,0,180-(I9-H9)),(K9-J9)))"
Else
Range("T9").Formula = "=IF((T8+U8)>=180,0,(IF(K9>I9,IF((I9-H9)>=180,180,(I9-H9)),IF((I9-H9)+(K9-J9)>=180,IF((K9-J9)>=180,0,180-(K9-J9)),(I9-H9)))))"
Range("U9").Formula = "=IF((T8+U8)>=180,0,(IF(K9<I9,IF((K9-J9)>=180,180,(K9-J9)),IF((I9-H9)+(K9-J9)>=180,IF((I9-H9)>=180,0,180-(I9-H9)),(K9-J9)))))"
End If............................

View 4 Replies View Related

Lock A Sheet But Still Make Some Edits/run Macro

Oct 18, 2009

Some of the sheets in my spreadsheet contain some data and graphs with a few macros that are run when a button is pressed. At the bottom I have some comments with a macro that is run to timestamp when these comments are updated or edited.

What I would like to do is lock the entire sheet so that the data and graphs can't be tampered with, apart from the comments part at the bottom because I'd like to be able to have the comments editable. So far I have managed to do that, but when I edit a comment and the timestamp code is run it creates a run-time error 1004. I could just remove the timestamp code I guess but I'd like to keep it there... figuring that there must be a solution.

How can I work around this problem ? Either by being able to keep the sheet locked and still have the timestamp code run, or have it temporarily unlock the sheet - run the code - and then re-lock the sheet.

View 10 Replies View Related

How To Make A Chart Using Text Data (Macro)

Apr 24, 2014

I have read quite a few tutorials but none of them really reference what I am trying to achieve. Essentially I have one column with 2 options: "Compliance" and "Improvement". I am trying to make a dynamic chart based on the number of occurrences. From my understanding you need to use a "Named Range" and "Count" but I can not find any information on how you combine the two to make a chart.

View 3 Replies View Related

Macro To Make Copying Cells Automate

May 3, 2014

I've got a problem with copying cells from table A to B.

A short insight of the situation:

Table A shows: ITEM_1 = 3, consequently ITEM_1 from table A is copied to table B for 3 times.

I've got a few huge information blocks to handle (up to 5000 items) obviously it's unreasonable to do this manually.

I've added an xlsx file with more detailed description.

Example_WHS.xlsx‎

View 8 Replies View Related

Macro / Formula To Make Summary Sheet?

May 18, 2014

I have a work book with 4 sheets in it. Now i want to make a summery sheet for this.

View 2 Replies View Related

How To Make This Macro Work For Auto Range

May 7, 2008

I have generated macro, all I want is when this macro runs on different work sheets it should automatically select the active range based upon column A and copy the formula in the inserted new column B, please see the macro which will make it clear. Basically whenever it is copying a value or a formula it should be for the active range.

View 11 Replies View Related







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