Trigger A Macro On Arrow Keys

Apr 24, 2007

I'm creating a small Excel RPG where the player moves the around a blank worksheet with the walls of a maze appearing as you approach them (think dark corridors, you can see only 1 cell in all directions around you).

The players current location is shown by excel setting the activecell to the players location. Currently I have four buttons labeled Up, Down, Left and Right which the player clicks to move in the desired direction.

The testers were frequently missing the four movement buttons and this would put the activecell outside of the maze next to one of the buttons. They'd have to move it back manually.

I would like for the players to move around using the arrow keys to use the activecell, as you would normally move around a sheet... but before each movement there is a procedure that check IF the player can move in the desired direction or not (cell borders used for walls), and then once they've moved there are more procedures to check for monsters treasure chests etc.

How can I make the arrow keys trigger the macros that the Up, Down, Left and Right buttons currently trigger, and not just move the activecell?

View 9 Replies


ADVERTISEMENT

Using Arrow Keys As Input VBA

Aug 5, 2013

I am trying to create the game of snake in VBA as practice, but I cannot find how to use the arrow keys as input. From what I have read it seems that it may not be possible, but how to change the value of a variable every time an arrow key is hit, post how to do so.

View 2 Replies View Related

Replicate Arrow Keys

Dec 16, 2009

I understand the end(x1Down), but i think I am missing something. I just want to go to the next cell left, right or Up, Down from whatever cell is currently selected. How do I replicate a 1 cell move as an arrow key would do?

View 9 Replies View Related

Cannot Scroll With Arrow Keys

Jul 18, 2006

For some reason, when i use my arrow keys to move from cell to cell it now only scrolls my screen around....What did i do, and how do i change it back? I find it sad that i can write code and this stumped me.

View 3 Replies View Related

Arrow Keys To Move The Box

Jul 5, 2007

When every I click in a excel box and try to use my arrow keys to move the box example: A3 to A4. All it does is move the page up and down or across. Is there some type of setting on that is not letting me do this. It use to allow me to. Until another employee got on it. I can not start over becouse I have months of work on this book.

View 2 Replies View Related

Disabling Arrow Keys For InputBox

Jan 8, 2009

I noticed the arrow keys will move the active cell while I have an inputbox active. This will be an issue for my users, I need them to key in data only.

Is there a command that will disable the arrow keys while the users enter the requested data?

View 10 Replies View Related

VBA Equivalent For Shift-Arrow Keys

Nov 7, 2007

Does anyone know the VBA equivalent to using the Shift-Arrow keys on the keyboard? I am wanting a macro to do this for me. Specifically I am wanting to use Shift-Arrow Right.

View 9 Replies View Related

Red Line Going Across The Spreadsheet While Using The Arrow Keys

Dec 31, 2008

if it's possible to have a red line going across the spreadsheet while using the arrow keys it follows you down through all cells. And is there a vba coding that someone has ready written.

View 9 Replies View Related

Arrow Keys Scroll Screen

May 23, 2008

I am relatively new to Excel 2007 and my arrow keys do not navigate cell by cell. When I press the right or left arrow keys, my entire screen shifts to the right or left but the cursor STAYS in the cell where it was. Likewise, when I press the up or down arrow keys the screen shifts up or down but again, the cursor remains where it was. Is there an option somewhere that I need to change?

View 3 Replies View Related

Arrow Keys Not Working On Protected Worksheet

May 4, 2008

Have a file that I have been coding and find when I open to a worksheet with limited access cells, the Up and Down arrows will not move vertically though Lrft and Right arrows OK though not raping arround. This problem may have been on for sometime and I haven't been back to it. Other Excel files all OK.

View 4 Replies View Related

Excel 2007 :: Arrow Keys Not Working In All Spreadsheets?

Dec 13, 2011

Arrow keys do not move from one cell to the next. They advance the page or panel view. No spreadsheet works correctly, (new or existing) and scroll lock is not set.

View 3 Replies View Related

Excel 2010 :: Vertical Arrow Keys Moving Out Of The Cell When Editing It

Aug 5, 2014

I am having this weird problem. The work laptop I received with excel 2010 does not allow me to use the vertical arrow keys when navigating through multiple lines when editing a cell. When editing the cell and I press the up or down arrow key, instead of moving to the next line within the cell, the cursor moves to the next cell. Is there a way / an option to have this fixed?

View 5 Replies View Related

Unable To Use Arrow Keys To Select Hidden Cells On A Protected Workbook

May 13, 2009

I have a problem with a spreadsheet I am working on, and I'm not sure if its something I've done, or whether its corrupted.

Basically, Column A is Hidden and not Locked in the protection tab of formatting. The other columns are Locked and not Hidden.

I used to be able to use the arrow keys to scroll through Column A, but this now doesn't seem to work. I can select the cells within column A with the mouse and I can scroll with the mouse and the scroll bars, but I can't move between the cells with the arrow keys, enter button or tab button.

Does anyone know what might be causing this, or is the workbook corrupt?

View 9 Replies View Related

Trying To Get My Sheets Back To Move From Cell To Cell With The Arrow Keys Please

Nov 3, 2008

I know this is a sooo basic question but I can not for the life of me remember how.....

when I am on a excel sheet I can not seem to move from quare to square qiththe arrow keys.
It just now takes me all the way to the left or all the way to the right and not from cell to cell from left to right.

I know its something rather simple yet I can not seem to figure this out.

I have no problem with this on 2003pro.

View 6 Replies View Related

Adjust Code From Cell Range Trigger To Button Trigger

Jul 1, 2014

I have the code below that is two separate activities and I want to change the second activity from a cell trigger (Set KeyCells = Range("K42:AD42")) to a button trigger. I need to first to remain unchanged.

I'd be ok if this was just one macro that I could assign to a button but because its two and I need to write the second's to clicking a button I'm over my head.

Its occured to me while writing this that because it'll be a range of buttons I'll probably need to make each one an individual code? Is this the case? If so I may have to just keep this as it is.

View 2 Replies View Related

Run Macro When Right Arrow Key Pressed

Apr 1, 2009

I have Sheet2 containing Supplier data in 2 columns - SupplierTAxCode and SupplierName (unsorted)

Sheet1 contains the Expenses section.

In Sheet1, column E6 to E1000, after inputting each SupplierTAxCode and pressing the RIGHT ARROW key, I would like to automatically get the SupplierName in column F6 to F1000 - from the corresponding data in Sheet2

In the event that the input in any of the cells in E6 to E1000 does not exist in SupplierTAxCode in Sheet2, would it be possible at the same time, to change the background color of the adjacent cell (SupplierName) in column F6 to F1000 at the same time - as a reminder to add those to the Supplier data in Sheet2 at a later date.

I could use Index Match and Conditional Formatting, but am concerned about the file sizes.

View 9 Replies View Related

Using Keys To Run A Macro

Dec 15, 2009

Are we limited to just the Control key to run macros?
Can I use the Alt key?

View 2 Replies View Related

Run Macro Via Shortcut Keys

Feb 10, 2010

The following macro works when I run using Alt+F8+Enter
The macro also works when it is linked to a button on the worksheet.
However, it does not work when I try to use the keyboard shortcut Ctrl+Shift+P.
I've tried adding the shortcut key code into the macro -- still doesn't work.
I've tried changing the shortcut key to a different letter

View 8 Replies View Related

Cannot Print After Using Send Keys In Macro

May 21, 2014

I finally found 'Sendkeys' and by having it press {ENTER} I was able to get my data to do what I wanted.

However now I cannot print my page. I tried everything.

Sub Macro2()
'
'
Sheets("List").Select
ActiveSheet.Cells(5 , 2).Select
Selection.Copy

[Code] ......

I can copy/paste other things just fine after the SendKeys but CANNOT PRINT!

View 5 Replies View Related

Keyboard Keys Are Not Working After Running Macro

Jul 24, 2014

I used keypress code in one of forms, after running following command non of my keyboard is working in excel. When I am restarting excel everything is fine. what could be the reason?

View 7 Replies View Related

Trigger Macro After 15 Seconds

Feb 22, 2009

I want to trigger a macro that refreshes a pivot table but I only want to trigger the macro after 15 seconds. The reason is that I am pulling the source data from access mdb so I want only to refresh the data once the data is pulled.

View 3 Replies View Related

How To Trigger Macro On A Condition

Jan 25, 2014

Is it possible to trigger a macro on a condition like this?

If date more than 1 week arrange date in sequence order.

View 2 Replies View Related

Drop-down Box Value To Trigger Macro

Jun 21, 2006

A1 is a drop-down list, created from Data> Validation>List, which lists 3 different words (Text1, Text2, Text3). I have recorded 3 macros (Macro1, Macro2, Macro3). Here's what I want to happen:

When Text1 is selected in A1, I want Macro1 to run (same for Text2/Macro2 and Text3/Macro3). I want the user to be able to change this value as many times as they wish and have the corresponding Macro run each time. I've tried creating the appropriate code in Editor using other threads on this forum, but I can't seem to figure it out.

View 8 Replies View Related

Trigger A Macro On Workbook Close?

Dec 5, 2008

When I open my workbook it also opens a separate workbook and hides second book.
when I close myworkbook I want to unhide the hidden one and close it without saving.

View 4 Replies View Related

Trigger Macro At The Start Of The Month

Feb 18, 2009

is possible to trigger a macro at the start of every month. I have a fairly simple bit of VBA, but just want it to execute on the 1st of every new month.

View 3 Replies View Related

Trigger Actions For Three Choices In A Macro

Dec 30, 2009

I have a series of macros altering various workbooks and sheets. They're numbered Step1, Step2, etc. In my Step5 I have a series of Case statements in a macro, and I don't know how to get it to do what I want next. I have NOT tried running this code yet, and I'm sure I have something(s) wrong in it.

1) If the selection in DstWbk, sheet "Steps", is "01DSP" through "11DSP" the macro needs to delete specific columns in the SrcWbk, and then move to the next step (6).

2) If the selection in DstWbk, sheet "Steps", is "*DSP" the macro needs to go directly to the next step (6)

3) If the selection in DstWbk, sheet "Steps", is anything else the macro needs to flash a generic "No Data found" message and move on to Step7.

The part of the code that's throwing me begins at 'Select only the specific regional data' and ends at the "Case Else MsgBox"

View 3 Replies View Related

Trigger A Macro :: Event On Enter

Jun 28, 2008

Does anyone no a way to trigger a macro by just using the enter key in a difined rage ("A1:A100") Not worksheetchange

View 9 Replies View Related

Trigger Macro With Worksheet Tab Selection

Jan 14, 2004

I have a macro I'd like to run when a worksheet tab is selected. The macro updates content in various cells.

That action is now triggered with a command button (linked to macro), but I'd like it to take place when the user selects that worksheet tab.

View 9 Replies View Related

Navigation Keys Quit Working After Workshee Change Macro

Mar 25, 2004

why my keyboard navigation keys (Tab and arrow keys) quit working after the code below executes? Other keyboard keys like alpha or numeric characters and Enter work but I can't move to another cell without clicking it. Selecting another ws, then returning to the "Master" ws fixes the problem. I tried activating Master near the end of the code but that didn't help. Master is not a protected sheet.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column 7 Or Target.Cells.Count > 1 Then Exit Sub
If IsEmpty(Target) Then Exit Sub
Dim NextRow As Long, MySheet As Worksheet
Set MySheet = Sheets(Target.Value)
NextRow = MySheet.Cells(Rows.Count, 1).End(xlUp).Row + 1
With MySheet
.Unprotect "1234"
Range(Cells(Target.Row, 1), Cells(Target.Row, 6)).Copy .Cells(NextRow, 1)
With .Cells(NextRow, 7).......................................................

View 9 Replies View Related

Macro To Move Data With Trigger Cell

Feb 21, 2010

I have a single workbook with five spreadsheets. My goal is to move data along a path (or work flow) from one sheet to the next by using a "trigger" pulldown menu choice.

Sheet1 = Prospects
Sheet2 = New Sale
Sheet3 = Upgrade Sale
Sheet4 = Won
Sheet5 = Lost
Sheets 1, 2, and 3 use the same data layout for column A - K.
Sheets 4 and 5 have the same A - K as above and also have columns L - R in common.
The last column in sheet 1, 2 and 3 is a pulldown menu (New, Upgrade, Won, Lost).

Data rows on each sheet start at row 7.

The goal is to use the pulldown choice to remove the data from the current sheet (ex: Prospect) and add it to the next open row in the required sheet (ex: New or Upgrade). I also need to be able to make a similar move from New/Upgrade to Won or Lost.

View 11 Replies View Related







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