Results 1 to 4 of 4

Using counter as cell reference

Threaded View

  1. #1
    Registered User
    Join Date
    02-01-2016
    Location
    Toronto, Canada
    MS-Off Ver
    2013
    Posts
    1

    Unhappy Using counter as cell reference

    Hi,

    I'm trying to run a program that goes down row by row, checks if two values are equal, and if not, replaces the second value with the first.

    I currently have a for loop set up as follows:

    For int i = 1 to 5
    (code)
    If Counter > Counter2 Then
                Worksheets("Sheet1").Range("A1:I1").Copy
                Worksheets("Sheet1").Range("L1:T1").Select
                Selection.Insert Shift:=xlDown
                ActiveSheet.Paste Destination:=Worksheets("Sheet1").Range("L1:T1") 
    End If
    Next i
    It checks the values correctly, but right now it just outputs the range A1:I1 5 times. I want it to output a range Ai:Ii, where i is the integer I'm using for my for loop.

    Is this possible?

    Thanks in advance for your help.
    Last edited by Richard Buttrey; 02-01-2016 at 04:59 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 8
    Last Post: 12-27-2013, 12:27 PM
  2. Counter to add 1 to another file's cell based on third cell's date.
    By slowery82 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-01-2013, 08:11 AM
  3. Creating a Cell reference counter
    By CG_Will in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-10-2012, 09:22 AM
  4. [SOLVED] Locating Duplicate Cell Data with a Cell Counter and Highlight
    By garrett.grillo in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-30-2012, 01:46 AM
  5. [SOLVED] Locating Duplicate Cell Data with a Cell Counter and Highlight
    By garrett.grillo in forum Excel General
    Replies: 1
    Last Post: 04-30-2012, 12:52 AM
  6. Reference counter
    By maxthebear in forum Excel General
    Replies: 2
    Last Post: 11-29-2011, 03:16 PM
  7. Using counter variable as cell reference
    By riwiseuse in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 10-22-2010, 03:03 PM
  8. Cell counter
    By Haza in forum Excel General
    Replies: 2
    Last Post: 01-20-2006, 10:20 AM

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