Free Microsoft Excel 2013 Quick Reference

Moving to "next" cell

How can I say to VB "please, move one cell to the right from the selected cell" ?

In a macro, I normaly select the last row from a particular column. I need to write something in the cell just next to the right from this last selected cell. My problem is that my files have different sizes, so I cannot use
Selection.End(xlDown).Select
Range("K267:L2").Select
because y my next file, that range will be "K300:L2", and in my next file it will be "K220:L2", and so forth. My idea is to tell VB to move one cell to the right from the active cell, and then go up until the first not empty cell.
Thanks


Post your answer or comment

comments powered by Disqus
On Excel 2003 how do I get the arrows on my keyboard to move me to next cell?
Right now my screen moves a tiny bit but doesnt not move me to next cell. I
just got this pc last week and I cannot figure this out. please help.

I have the following code :-

Check = True: Counter = 0: r = 50 ' Initialize variables.
Do ' Outer loop.
Do While Counter < 1137 ' Inner loop.
r = 50 + Counter 'start row
For C = 15 To 25 'start Column

If Cells(r - 3, 1).Value = "Y" And Cells(r - 3, 2).Value = 3 Then
Cells(r - 1, C).Clear
If Cells(r, C).Value = 0 Then
Cells(r - 1, C).Value = (Cells(r - 2, C).Value - Cells(r, C -
1).Value) _
+ ((Cells(r - 2, C + 1).Value) * (Cells(r - 3, 11).Value) / 4)
ElseIf (Cells(r, C).Value < (Cells(r - 2, C + 1).Value) * (Cells(r
- 3, 11).Value) / 4) Then
Cells(r - 1, C).Value = (Cells(r - 2, C + 1).Value + Cells(r - 2, C
+ 2).Value)
End If
End If
Next C

Counter = Counter + 4 ' Increment Counter.
If Counter > 1137 Then ' If condition is True.
Check = False ' Set value of flag to False.
Exit Do ' Exit inner loop.
End If
Loop
Loop Until Check = False ' Exit outer loop immediately.

But need the formula in Cellc(r,C) to recalculate before moving to next
c.
I have Autocalulate off as takes to long to run with Autocalulate On

Is there other syntax that can be used other than:

Range("A23").Select?

I'm trying to move to any cell below some text. So, it will find "Total" and move the cell below.

Also, is there any way to specify to select cells without specifying the actual cell name?

Thanks!

Hey guys, I was hoping someone can help me with this puzzle.

I was wondering if it is possible to move to another cell after a Macro has finished executing.

For example, the Active Cell is A1. After the Macro executes, I want the selected/active cell to be A2. How do I do this?

Here is the code I have so far...

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$1" Then ActiveWorkbook.RefreshAll
---Move to Active Cell "A2"
End Sub

Thanks guys.


	VB:
	
 checklist() 
    Dim myRange As Object 
    Set myRange = Range("B3:B305") 
    myRange = "=INT((200-5+1)*RAND()+5)" 
    myRange.Copy 
    myRange.PasteSpecial 
    Range("b3").Select 
    For Each myRange In Range("B3:b305") 
        If ActiveCell < 100 Then 
            Selection.Clear 
             
        Next 
         
         
         
    End Sub 

If you like these VB formatting tags please consider sponsoring the author in support of injured Royal Marines
This is what i have so far im trying to move to the next cell and if that cells is < 100 i should clear it. its in range of (b3:b305)

I have been using the following code to add check marks to my spread sheet on a double click. I would like to modify the code to add the check mark and move to the next unlocked cell after double clicking. The "Selection.Offset(0, 1).Select" statement doesn't skip the locked cells. Any help would be appreciated.

Glenn

Code:

	Code:
	
   If Target.Count > 1 Then Exit Sub
   'Isolate Target to a specific range
   If Intersect(Target, Range("myChecks")) Is Nothing Then Exit Sub
   'set Target font tp "marlett"
   Target.Font.Name = "marlett"
   'Check value of target
   If Target.Value  "a" Then
       Target.Value = "a" 'Sets target Value = "a"
       Cancel = True
       Selection.Offset(0, 1).Select
       Exit Sub
   End If
   If Target.Value = "a" Then
       Target.ClearContents 'Sets Target Value = ""
       Cancel = True
       Selection.Offset(0, 1).Select
       Exit Sub
   End If
 
End Sub


Hello,

I'm working with a .txt file openned at Excel. As information doesn't come from a database itself, I must rearrange data.
Once I have the information in Excel it looks like:

______A________ |_______B_________|
1 |Arrival time___ |__Number/Modifier _|
2 |_____________ |__456482_________|
3 |__12:30_______|__ Late___________|
4 |__24:00_______|__Missing_________|
5 |______________|__456231_________|
6 |__10:00_______|_________________|
7 |__24:00_______|__Missing__________|
8 |__12:30_______|__Late____________|
9 |______________|__321684_________|
10 |_10:00_______|_________________|
11 |_12:30_______|__Late____________|

The task is to find the number that is "Late". If Late means equal to 12:30, I thought about creating a macro that filters column A with that criteria. Then it should select cell B1 and using a function that emulates the key board's down arrow move to the next filtered result (which would be B3)

Once B3 is selected the macro can go up until it finds the first numeric result and it can assign this value to B3 (the filtered cell)

The problem is that I haven't been able to find that function that emulates the key board's arrow to move from B1 to B3 and then to B8 and B11.

I've seen that the common answer to this kind of problem is to copy filtered results to another place. Nevertheless, this solution won't work for my application because I need to use data that is out of the filtered result.

Can anyone help me?

Thanks a lot!
Regards!
Aldaco.

Hello,
I have a worksheet that I am working on and it basically is recording the a date and percentage for that date.Now it recieves the information from the first sheet in the workbook. What i want it to do is the date and percentage to move to next availiable cells when opening the workbook.Any help would be appreciated, Thanks

In the past, the cursor keys would move to the next cell
(up/down/left/right). Now, they act like I moved the screen using the scroll
bar. How can I get them back to where they move to the next cell?

I run a monthly report and need to copy the data from one sheet to another sheet. I want to move to the next cell after I have copied the data.

This is the code I have so far:


	VB:
	
 cablefab() 
     
    Sheets("Cable Fab").Select 
    Range("A18").Select 
    Selection.AutoFill Destination:=Range("A18:A19"), Type:=xlFillDefault 
    Range("A18:A19").Select 
    Sheets("Jun 11").Select 
    Selection.Copy 
    Sheets("Cable Fab").Select 
    Range("C19").Select 
    ActiveSheet.Paste 
     
End Sub 

If you like these VB formatting tags please consider sponsoring the author in support of injured Royal Marines
I am wanting to copy from "Jun 11" and move it to "Cable Fab" I will be running one for July and want to move that one to the next cell.
Any ideas?

Attached are screen shots of the datadata sheet.jpgdata sheet.jpg

This sounds fairly simple to do but I can't think of how to actually do it.
I would like to have about 15 cells available to type text into (they are stretched to be about the size of half a page long and the normal height of a line. I don't want to merge the cells together) and I would like to be able to start in the first cell and when the text comes to the end of that space (not the total amount the cell can hold but the space shown as if you were writing on a piece of paper) you are moved down to the next cell down without having to press enter.

Can that be done?

Hello,

I'm looking to create a user form to quickly enter information into a spreadsheet. I'm new to Excel forms and have searched, but can't seem to find examples of what I'm looking for.

I've tried to keep this example simple. In short, I would like to be able to call a form from any tab inside a workbook, then based on the cell I choose enter information in the empty cells below it. I think the process would work as detailed below;

User will select a specific cell (D6)
User will call UserFormA
UserFormA will move to the first empty cell below specified cell (D8)
Display Value in Cell (B8) in TxtBoxA
If ChkBoxA is true then (D8)=1 else (D8)=0
If ChkBoxB is true then (E8)=1 else (E8)=0
If ChkBoxC is true then (F8)=1 else (F8)=0
When CmdButtonA is pressed apply Values to cells D8, E8, and F8
Move to Next Empty Cell (D9)
Display Value in Cell (B9) in TxtBoxCurrName
If ChkBoxA is true then (D9)=1 else (D9)=0
If ChkBoxB is true then (E9)=1 else (E9)=0
If ChkBoxC is true then (F9)=1 else (F9)=0
When CmdButtonA is pressed apply Values to cells D9, E9, and F9
Move to Next Empty Cell (D10)
Repeat until UserFormA closed

Thank you for taking the time to look this over.

JJ

All,

I thought I had this, but....
What I need is to remove the data in cell A1 if in cell D1 it
states;"Would you like to add any comments?"...then move to the next
row/cell until cell A(whatever) contains no data.

Sub Test()
Dim Cell As Range
For Each Cell In Range("D:D")
If Range("D1") = "Would you like to add any comments?" Then
Range("A1") = ""
Next
End Sub

Any help is appreciated

Hans

Hi, I need the formula to make filling in a users phone number easy. They would type in their first three numbers ( Area Code), the cursor would then automatically move to the next cell to the right (without having to push enter) The new cell would allow them to put in 3 more numbers, then moves to the next cell for the last 4 numbers, then to the next cell for a possible 5 digit extension.
Thank U!!

Hello,

I would like to know the Macro code for Moving the Values of a cell to
next cell based upon values in a particular cell.

Ex:-

Col A(DATE) Col B(0-30 Days) Col C(30-60days) ColD(60-90day)

Jan-05 10
Feb-05 10

Based upon date in Col A i want move the value in col b and c to the
next cell.Basically this for aging the items in the work sheet

right now i have it so that i can click the box on and off but what i want it to do is if cell a1 is filled move to cell a2

this is easy i know but my brain is on vacation

thanks


	VB:
	
 CheckBox1_Click() 
    If ActiveSheet.Shapes("Check Box 1").ControlFormat.Value = xlOn Then 
        Sheets("careplan").Select 
        Range("A1").Value = "Check Box is ON" 
Else: 
        Sheets("careplan").Select 
        Range("A1").Value = "" 
         
    End If 
End Sub 

If you like these VB formatting tags please consider sponsoring the author in support of injured Royal Marines


I tried researching on the site, but couldn't exactly find what I was looking for.

I am trying to simply move the cell selection to the right one cell. I do not want to select both cells, just move over one cell.

I know that you Excel VBA guru's out there can answer this in about 3 seconds.

Thank you in advance!!

Ok first of all I having been working with a company for about three years. Most of our paperwork has to be completed using excel. Basic paperwork like corrective counsellings and record of conversations. I always wondered why we don't use word... The way they have the excel formatted is we have to type each individual line into a cell Instead of wrapping text in one cell and underlining it. So what I would like to do Is have excel go automatically to the next row below when the cell is visibly full. Usually I get paperwork back with corrections which causes me to have to readjust cells using copy and paste and is very time consuming.... Thanks In advance....

My direction keys currently move the screen instead of move from one cell to another. For instance, I will have cell A1 highlighted and then press the down key. Instead of going to A2, it stays at A1 but the screen moves down one cell. Thank you for any help!

I currently have the code below to code below to update a set of records on "MyList" based on the values on "Moved" Sheet. I need to adjust the VBA to move to the record on "Moved" if not found in the Sheet "MyList". It also needs to begin with Row 2 of "Moved".

Here is my current code:

Sub CopyMovedReportToMyList()
Dim Sheet1 As Worksheet, Sheet2 As Worksheet
ar = ActiveCell.Row
Dim Src As Range, Destrw As Long
Set Sheet1 = Sheets("MyList")
Set Sheet2 = Sheets("Moved")

Application.ScreenUpdating = False
Application.EnableEvents = False
Application.Calculation = xlCalculationManual

On Error GoTo Abort
Columns("A:A").Select
Selection.NumberFormat = "General"
Range("A2").Select

Columns("A:A").Select
Application.CutCopyMode = False
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
'Insert Move Report Date
Range("U1").Select
ActiveCell.FormulaR1C1 = "Date"
Dim LstRow1, LstRow2 As Long
LstRow1 = Sheet2.Range("A65536").End(xlUp).Row
With Sheet2
Range("U2" & ":U" & LstRow1).Value = InputBox("Enter the Date of the Move Report: ", "Update Account Basics...")
End With

Range("A2").Select

Do While Len(Range("A" & ar).Formula) > 0
' repeat until first empty cell in column A

Destrw = Sheet1.Range("A:A").Find(what:=Sheet2.Cells(ar, 1).Value, _
After:=Sheet1.Range("A1"), LookIn:=xlFormulas, Lookat:=xlWhole, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:=False).Row
With Sheet1
'update Moved to List Name, DD, DDC, Moved to List##
.Cells(Destrw, 78).Value = Sheet2.Cells(ar, 5).Value
.Cells(Destrw, 79).Value = Sheet2.Cells(ar, 6).Value
.Cells(Destrw, 80).Value = Sheet2.Cells(ar, 7).Value
.Cells(Destrw, 81).Value = Sheet2.Cells(ar, 20).Value

'inserts date for Report
.Cells(Destrw, 77).Value = Sheet2.Cells(ar, 21).Value

End With

ar = ar + 1 ' next row
Loop

Application.ScreenUpdating = True
Application.EnableEvents = True
Application.Calculation = xlCalculationAutomatic

'Autofilter
Sheets("MyList").Select
ActiveWindow.ScrollColumn = 74
Range("A:CE").Sort Key1:=Range("CC1"), Order1:=xlDescending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Range("CC2").Select

Exit Sub
Abort:
MsgBox Sheet2.Range("A3").Value & " was not found in column A of the sheet 'MyList'"
Application.ScreenUpdating = True
Application.EnableEvents = True
Application.Calculation = xlCalculationAutomatic

End Sub

I am working in a spreadsheet where I am transfering numbers from paper. Each
cell has a set amount of digits. For example the first cell is a 3 digit
number. The next a 4 digit number, then a 2 digit number.

Is there anyway I can set it up just like some web pages that have phone
numbers, so that when I input the 3 digit number the cursor jumps to the next
cell, then input the 4 digits, jumps to the next cell and I put in the 2
digit number.

Thanks for the help.

I have posted this as a new user but hought I may get a better reponse
here.I am using ms excel to enter data, 1 for Yes and 2 for No, for 300
items/questions listed successively in column A. The data is then
tallied on another excel page. However, I would like to have the entry
of 1 or 2 provide the jump to the next cell down ( each time1 or 2 is
entered) rather than have to always press enter key to go to the next
cell. Any ideas how to proceed?

--
johnexcel
------------------------------------------------------------------------
johnexcel's Profile: http://www.excelforum.com/member.php...o&userid=26600
View this thread: http://www.excelforum.com/showthread...hreadid=398818

I am using a barcode scanner to read in barcode numbers into excel. But
everytime after I scan a barcode, excel moves to the cell in the next row.
What I want is moves down to the next column.
Anyone with information please help.

Thankyou very much!

I have posted this as a new user but hought I may get a better reponse here.I am using ms excel to enter data, 1 for Yes and 2 for No, for 300 items/questions listed successively in column A. The data is then tallied on another excel page. However, I would like to have the entry of 1 or 2 provide the jump to the next cell down ( each time1 or 2 is entered) rather than have to always press enter key to go to the next cell. Any ideas how to proceed?

Morning All

I am trying to get select information out of text file and place the information in a specific cell in a workbook. The information is xml like but more like headers (begin and end statements) with the data embedded between them. I'm not sure on how to move to the next line within the loop or manually loop through the file.

Open Filename
For Input As #1

Do Until EOF(1)
        Line Input #1, Information
        
        Information = Trim(Information)   'get rid of leading and trailing space
        
        If Information = "Begin Heading" Then
		Move to next line in file
		extract number from string "Value=12345"
		send to workbook cell location

		Move to next line in file
		extract units from string "Units=kg/m^3"
		send to work workbook cell 

	if information = "End Heading"
		move to next line or heading in file
        
Loop

Close #1
Suggestions?

Bob


No luck finding an answer? You could always try Google.