+ Reply to Thread
Results 1 to 2 of 2

Looping Issue

  1. #1
    Registered User
    Join Date
    01-06-2015
    Location
    Dallas, TX
    MS-Off Ver
    10
    Posts
    35

    Looping Issue

    Hey guys, I'm having a heck of a time to get my looping macro to function properly. I have a workbook that contains a variable number of worksheets. I'm running significant formatting drills on all worksheets to automate most of my manual work. In this scenario I have a workbook with 65 worksheets all uniquely named. I need the value in cell A3 of each worksheet to relocate itself to the bottom of the data in column E of its own worksheet. Here's what I've got:

    Sub RelocateTotalInvoice()
    '
    ' RelocateTotalInvoice Macro

    Dim ws As Worksheet
    For Each ws In Worksheets

    Range("A3").Select
    Selection.Copy
    Selection.End(xlToRight).End(xlDown).Select
    ActiveCell.Offset(1, 0).Select
    ActiveSheet.Paste

    Next ws

    End Sub

    The problem I'm having is that the formula will just repeat itself on the first worksheet instead of moving to the next worksheet and repeating there so it just pastes the same value 65 times one cell beneath the next. I've tried moving the "Next ws" up in the formula to before "ActiveCell.Offset(1, 0).Select" this modified the vba to only post the value once in the active worksheet instead of 65 times, but it still wouldn't move to the next worksheet to continue the process. Help please

  2. #2
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,125

    Re: Looping Issue

    How about
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Looping through 2D array prints the same value issue
    By Toffes in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-15-2016, 05:39 PM
  2. Odd macro looping issue
    By mattmickle in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-28-2015, 04:16 PM
  3. Looping issue for csv clean-up macro
    By jerrydiaz in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-02-2014, 12:47 PM
  4. Looping issue
    By wani in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-30-2012, 02:23 AM
  5. Need help with looping issue
    By SDBoca in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-08-2011, 08:18 PM
  6. Bizarre VBA Looping issue...
    By valverde311 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-10-2011, 04:25 PM
  7. Looping issue
    By davidm in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-08-2005, 01:58 PM

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