Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-12-2019, 05:27 PM
Moot70 Moot70 is offline Need help creating vba code Windows 10 Need help creating vba code Office 2019
Novice
Need help creating vba code
 
Join Date: Oct 2019
Location: Oklahoma
Posts: 16
Moot70 is on a distinguished road
Default

i have file I column B & F I want go back forth B & F in color area only

sample B3 than F3 I press enter or tab F3 I press enter than go down to B4 back for until F18 reach F18 I want go back to B3


Thanks You


Moot70

week 1-17 pick them

red color cells is unpick teams. i need code that go through column B and column F pick them

B3 when I press tab or enter key it will goto F3 than goto B4
B4 when I press tab or enter key it will goto F4 than goto B5
B5 when I press tab or enter key it will goto F5 than goto B6
B6 when I press tab or enter key it will goto F6 than goto B7
B7 when I press tab or enter key it will goto F7 than goto B8
B8 when I press tab or enter key it will goto F8 than goto B9
B9 when I press tab or enter key it will goto F9 than goto B10
B10 when I press tab or enter key it will goto F10 than goto B11
B11 when I press tab or enter key it will goto F11 than goto B12
B12 when I press tab or enter key it will goto F12 than goto B13
B13 when I press tab or enter key it will goto F13 than goto B14
B14 when I press tab or enter key it will goto F14 than goto B15
B15 when I press tab or enter key it will goto F15 than goto B16
B16 when I press tab or enter key it will goto F16 than goto B17
B17 when I press tab or enter key it will goto F17 than goto B18
B18 when I press tab or enter key it will goto F18

Blue color cells is unpick teams. i need code that go through column B and column F
wild card & division pick them

B3 when I press tab or enter key it will goto F3 than goto B4
B4 when I press tab or enter key it will goto F4 than goto B5
B5 when I press tab or enter key it will goto F5 than goto B6
B6 when I press tab or enter key it will goto F6

Conf Championship them
B3 when I press tab or enter key it will goto F3 than goto B4
B4 when I press tab or enter key it will goto F4

Super Bowl Pick Them
B3 when I press tab or enter key it will goto F3

I have this code

Private Sub Worksheet_Change(ByVal Target As Range) Dim tabArray As Variant
Dim i As Long
tabArray = Array("B3", "F3", "B4", "F4", "B5", "F5", "B6", "F6", "B7", "F7", "B8", "F8", "B9", "F9", "B10", "F10",

"B11", "F11", "B12", "F12", "B13", "F13", "B14", "F14", "B15", "F15", "B16", "F16", "B17", "F17", "B18", "F18")
Application.ScreenUpdating = False
For i = LBound(tabArray) To UBound(tabArray)
If tabArray(i) = Target.Address(0, 0) Then
If i = UBound(tabArray) Then
Me.Range(tabArray(LBound(tabArray))).Select
Else
Me.Range(tabArray(i + 1)).Select
End If
End If
Next i


Application.ScreenUpdating = True
End Sub

The code that is above is no working way I want to work. It should B3,F3 down to B18,F18

I need help fix the code to make it work way I want work


TY
Thomas

picture give you visible
Attached Images
File Type: jpg PICK THEM WEEK 1 UNPICKED.jpg (122.8 KB, 45 views)
File Type: jpg PICK THEM WEEK 1 PICKED.jpg (138.0 KB, 44 views)
Attached Files
File Type: xlsm NFL PICK THEMS.xlsm (108.8 KB, 10 views)
Reply With Quote
  #2  
Old 10-24-2019, 06:12 AM
NoSparks NoSparks is offline Need help creating vba code Windows 7 64bit Need help creating vba code Office 2010 64bit
Excel Hobbyist
 
Join Date: Nov 2013
Location: British Columbia, Canada
Posts: 831
NoSparks is just really niceNoSparks is just really niceNoSparks is just really niceNoSparks is just really niceNoSparks is just really nice
Default

See if this is what you're looking for
Attached Files
File Type: xlsm NFL PICK THEMS_v2.xlsm (102.9 KB, 19 views)
Reply With Quote
  #3  
Old 10-25-2019, 02:57 PM
Moot70 Moot70 is offline Need help creating vba code Windows 10 Need help creating vba code Office 2019
Novice
Need help creating vba code
 
Join Date: Oct 2019
Location: Oklahoma
Posts: 16
Moot70 is on a distinguished road
Default hi

It look same to me. What did you done to it?



There are no vba codes?


TY
Moot70
Reply With Quote
  #4  
Old 10-25-2019, 03:42 PM
Alansidman's Avatar
Alansidman Alansidman is offline Need help creating vba code Windows 10 Need help creating vba code Office 2019
עַם יִשְׂרָאֵל חַי
 
Join Date: Apr 2019
Location: Steamboat Springs
Posts: 79
Alansidman will become famous soon enoughAlansidman will become famous soon enough
Default

I can make this happen with a Before Double Click Event. This will need to be pasted into each Worksheet event. Could not develop a global event.

Code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
    ActiveCell.Offset(0, 4).Select
End Sub
Reply With Quote
  #5  
Old 10-25-2019, 04:55 PM
NoSparks NoSparks is offline Need help creating vba code Windows 7 64bit Need help creating vba code Office 2010 64bit
Excel Hobbyist
 
Join Date: Nov 2013
Location: British Columbia, Canada
Posts: 831
NoSparks is just really niceNoSparks is just really niceNoSparks is just really niceNoSparks is just really niceNoSparks is just really nice
Default

Quote:
Originally Posted by Moot70 View Post
It look same to me. What did you done to it?



There are no vba codes?


TY
Moot70
Alt + F11 to open the VBA environment.
Double click ThisWorkbook to open ThisWorkbook module.
Reply With Quote
  #6  
Old 10-25-2019, 07:34 PM
Alansidman's Avatar
Alansidman Alansidman is offline Need help creating vba code Windows 10 Need help creating vba code Office 2019
עַם יִשְׂרָאֵל חַי
 
Join Date: Apr 2019
Location: Steamboat Springs
Posts: 79
Alansidman will become famous soon enoughAlansidman will become famous soon enough
Default

@NoSparks

I have tested your code and it does not work for me. It only moves the cursor one cell over or one cell down. It does not move as the OP has requested.

--A
Reply With Quote
  #7  
Old 10-25-2019, 11:31 PM
NoSparks NoSparks is offline Need help creating vba code Windows 7 64bit Need help creating vba code Office 2010 64bit
Excel Hobbyist
 
Join Date: Nov 2013
Location: British Columbia, Canada
Posts: 831
NoSparks is just really niceNoSparks is just really niceNoSparks is just really niceNoSparks is just really niceNoSparks is just really nice
Default

@Alansidman

If you go strictly by what they put in the first post, I agree with you.
Then I look at their second post and wonder what they actually do require,
so I just implemented the Worksheet_Change event code that they posted.

Determining if leaving a cell is the result of the Tab key or Enter key, as in post 1,
and not an Arrow key, the Home key, the Page Up or Page Down key or a mouse click in another cell is way beyond me
although I would be very interested in seeing that solution.


NoSparks
Reply With Quote
  #8  
Old 10-26-2019, 06:07 PM
Alansidman's Avatar
Alansidman Alansidman is offline Need help creating vba code Windows 10 Need help creating vba code Office 2019
עַם יִשְׂרָאֵל חַי
 
Join Date: Apr 2019
Location: Steamboat Springs
Posts: 79
Alansidman will become famous soon enoughAlansidman will become famous soon enough
Default

crossposted: I need help creating a vba code column B & column goto F
Reply With Quote
  #9  
Old 10-26-2019, 09:20 PM
Moot70 Moot70 is offline Need help creating vba code Windows 10 Need help creating vba code Office 2019
Novice
Need help creating vba code
 
Join Date: Oct 2019
Location: Oklahoma
Posts: 16
Moot70 is on a distinguished road
Default update

Please take look a picture than the file than to create a vba code
Attached Images
File Type: jpg COLUMN B TO COLUMN F.jpg (199.3 KB, 29 views)
Attached Files
File Type: xlsm COLUMN B TO COLUMN F.xlsm (16.8 KB, 6 views)
Reply With Quote
  #10  
Old 10-27-2019, 01:53 AM
Alansidman's Avatar
Alansidman Alansidman is offline Need help creating vba code Windows 10 Need help creating vba code Office 2019
עַם יִשְׂרָאֵל חַי
 
Join Date: Apr 2019
Location: Steamboat Springs
Posts: 79
Alansidman will become famous soon enoughAlansidman will become famous soon enough
Default

Did you try the suggestion I posted in Post #4? As there has been no response to it?
Reply With Quote
  #11  
Old 10-27-2019, 05:04 AM
Moot70 Moot70 is offline Need help creating vba code Windows 10 Need help creating vba code Office 2019
Novice
Need help creating vba code
 
Join Date: Oct 2019
Location: Oklahoma
Posts: 16
Moot70 is on a distinguished road
Default

I have try that code only to next column
Reply With Quote
  #12  
Old 10-27-2019, 01:02 PM
Alansidman's Avatar
Alansidman Alansidman is offline Need help creating vba code Windows 10 Need help creating vba code Office 2019
עַם יִשְׂרָאֵל חַי
 
Join Date: Apr 2019
Location: Steamboat Springs
Posts: 79
Alansidman will become famous soon enoughAlansidman will become famous soon enough
Default

Interesting because when I placed it in your workbook, it worked for me. Did you place the code in the regular module or in the worksheet event? This would make a big difference. To place in a worksheet event, open the VBE. In the left window click on the worksheet you have the data in. A window should open in the right side of your screen. Copy my code and paste it into that new window. Save and close. Now try it.
Reply With Quote
  #13  
Old 10-27-2019, 11:32 PM
Moot70 Moot70 is offline Need help creating vba code Windows 10 Need help creating vba code Office 2019
Novice
Need help creating vba code
 
Join Date: Oct 2019
Location: Oklahoma
Posts: 16
Moot70 is on a distinguished road
Default

can you show me with a picture or a copy of file with code and where I put it code.


TY


Moot70

Last edited by Moot70; 10-28-2019 at 08:52 AM.
Reply With Quote
  #14  
Old 10-28-2019, 01:48 PM
Alansidman's Avatar
Alansidman Alansidman is offline Need help creating vba code Windows 10 Need help creating vba code Office 2019
עַם יִשְׂרָאֵל חַי
 
Join Date: Apr 2019
Location: Steamboat Springs
Posts: 79
Alansidman will become famous soon enoughAlansidman will become famous soon enough
Default

Excuse the penmanship. Difficult to write freehand.
Attached Images
File Type: jpg Capture.JPG (95.7 KB, 26 views)
Reply With Quote
  #15  
Old 10-28-2019, 02:41 PM
Moot70 Moot70 is offline Need help creating vba code Windows 10 Need help creating vba code Office 2019
Novice
Need help creating vba code
 
Join Date: Oct 2019
Location: Oklahoma
Posts: 16
Moot70 is on a distinguished road
Default

Code:
Private Sub Worksheet_Change(ByVal Target As Range) Dim tabArray As Variant
Dim i As Long
tabArray = Array("B3", "F3", "B4", "F4", "B5", "F5", "B6", "F6", "B7", "F7", "B8", "F8", "B9", "F9", "B10", "F10",

"B11", "F11", "B12", "F12", "B13", "F13", "B14", "F14", "B15", "F15", "B16", "F16", "B17", "F17", "B18", "F18")
Application.ScreenUpdating = False
For i = LBound(tabArray) To UBound(tabArray)
If tabArray(i) = Target.Address(0, 0) Then
If i = UBound(tabArray) Then
Me.Range(tabArray(LBound(tabArray))).Select
Else
Me.Range(tabArray(i + 1)).Select
End If
End If
Next i
Application.ScreenUpdating = True
End Sub
Where I put this code at?


TY
Moot70

Last edited by Moot70; 10-29-2019 at 01:38 AM.
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a QR code in microsoft word? ayupchap Word 1 08-20-2019 02:30 PM
Need help creating vba code Creating and Referencing Drop Down Text Boxes in VBA code cjkmarx Word VBA 1 12-12-2016 03:20 PM
Need help creating vba code Code to creating a custom TOC including too many styles amer1749 Word VBA 4 07-03-2016 10:42 AM
creating a code to create dynamic text in word ah8471 Word VBA 1 12-29-2015 10:52 PM
Creating VBA Code to Delete Empty Column in Table Faugs Word VBA 5 08-07-2014 03:29 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:25 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft