Results 1 to 4 of 4

need help with VBA code for moving though designated calls automatically

Threaded View

nicody need help with VBA code for... 09-24-2019, 10:13 PM
AlphaFrog Re: need help fixing error 09-24-2019, 11:45 PM
nicody Re: need help fixing error 09-26-2019, 05:41 PM
Pepe Le Mokko Re: need help fixing error 09-25-2019, 03:01 AM
  1. #1
    Registered User
    Join Date
    05-07-2018
    Location
    ontario, canada
    MS-Off Ver
    standard 2019
    Posts
    56

    need help with VBA code for moving though designated calls automatically

    Hi,

    I got some code from a previous thread and it has worked beautifully.

    Private Sub Worksheet_Change(ByVal Target As Range) If Target.Cells.Count > 1 Then Exit Sub 'multiple cells changed If Not Intersect(Target, Range("A3:A300")) Is Nothing Then Application.Goto Target.Offset(0, 2) End If If Not Intersect(Target, Range("C3:C299")) Is Nothing Then Application.Goto Target.Offset(1, -2) End If End Sub
    I tried to adapt it for another worksheet that I am creating but seem to keep getting an error.

    This is how I changed it:

    Private Sub Worksheet_change(ByVal target As Range) 'to move through appropriate cells If target.Cells.Count > 1 Then Exit Sub 'multiple cells changed If Not Intersect(target, Range("a3:a1000")) Is Nothing Then Application.Goto target.Offset(0, 3) End If If Not Intersect(target, Range("d3:d1000")) Is Nothing Then Application.Goto target.Offset(0, 2) End If If Not Intersect(target, Range("f3:f999")) Is Nothing Then Application.Goto target.Offset(1, -5) End If
    It is Run-time error '1004':

    application-defined of object-defined error
    on the last line --Application.goto target.Offset(1, -5)

    and it is not cycling through the cells, it is just going down to the next row.

    I want to enter a number in A2 and have it go to cell D2, then F2 then A3 and so on after a value is entered in each cell.

    Can anyone fix this for me please. Thanks in advance.
    Last edited by nicody; 09-26-2019 at 05:29 PM. Reason: revising title

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Fixing runtime error '53'
    By Bronx in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-03-2016, 09:28 AM
  2. [SOLVED] Index range fixing error
    By silambarasan.J in forum Excel General
    Replies: 4
    Last Post: 01-27-2016, 06:44 AM
  3. Fixing Date Error -
    By JCL622 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-07-2013, 10:54 AM
  4. [SOLVED] Help me in fixing the error
    By kishoremcp in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-26-2012, 07:26 AM
  5. [SOLVED] Fixing a sorting error for empty rows (error '1004')?
    By StargateFan in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-02-2005, 06:20 PM
  6. Fixing a sorting error for empty rows (error '1004')?
    By StargateFan in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-02-2005, 06:17 PM
  7. Fixing the #DIV/0! Error
    By kc2equ in forum Excel General
    Replies: 1
    Last Post: 02-22-2005, 11:32 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1