+ Post New Thread
Results 1 to 2 of 2
Office Software Thread, Macros in Excel 2003 in Technical; Hi, I am trying to create a macro that will collect information from particular cells in an Ecel spreadsheet (A) ...
  1. #1

    Join Date
    Mar 2008
    Location
    Guildford
    Posts
    73
    Thank Post
    3
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Macros in Excel 2003

    Hi,

    I am trying to create a macro that will collect information from particular cells in an Ecel spreadsheet (A) and copy and paste them into another spreadsheet (B).

    I can do this no problem, but the issue is that I want to run this same macro on a number of different spreadsheets, so that all the information get pasted into spreadsheet B.

    How can I do this so that the information selects the next available column or row to paste to, rather than always pasting into the same row, therefore replacing data or throwing out an error message?

  2. #2
    The_Original_Invisible's Avatar
    Join Date
    May 2009
    Location
    Swindon
    Posts
    6
    Thank Post
    0
    Thanked 3 Times in 3 Posts
    Rep Power
    0
    Have a look at this code

    Sub ConsolLoop()
    Sheets(4).Select
    Cells.ClearContents
    r = 0
    n = 0

    For i = 1 To 3
    Sheets(i).Select
    GoSub DoCopy
    GoSub DoPaste
    n = n + r
    Next i

    Exit Sub

    DoCopy:
    Cells(1, 1).CurrentRegion.Select
    Selection.Copy
    r = Selection.Rows.Count
    Return

    DoPaste:
    Sheets(4).Select
    Cells(1, 1).Offset(n, 0).Select
    ActiveSheet.Paste
    Return

    End Sub

    It merges all data from the first 3 worksheets in to the 4th worksheet

    I'm sure you'll work out how to adapt it to meet your requirements

    Hope it helps

    Lee

SHARE:
+ Post New Thread

Similar Threads

  1. Unable to print from Word or Excel 2003
    By pennywest in forum Windows
    Replies: 8
    Last Post: 30th November 2009, 06:41 AM
  2. Excel 2003 problem with chart...
    By kennysarmy in forum Windows
    Replies: 6
    Last Post: 12th December 2008, 07:04 PM
  3. [MS Office - 2003] Excel 2003
    By jcs808 in forum Office Software
    Replies: 0
    Last Post: 24th September 2008, 10:59 AM
  4. Help!!!!!!! With Excel 2003
    By jodielynn in forum Windows
    Replies: 3
    Last Post: 16th May 2007, 04:19 PM
  5. Excel 2003 print preview discrepancy
    By danIT in forum Windows
    Replies: 1
    Last Post: 28th September 2006, 01:17 PM

Thread Information

Users Browsing this Thread

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

Tags for this Thread

Posting Permissions

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