Results 1 to 2 of 2

Problem using a macro from one workbook for a smilar purpose in another workbook

Threaded View

SMcuthbert Problem using a macro from... 07-26-2013, 04:09 PM
protonLeah Re: Problem using a macro... 07-26-2013, 08:10 PM
  1. #1
    Registered User
    Join Date
    07-24-2013
    Location
    Boston, MA
    MS-Off Ver
    Excel 2010
    Posts
    32

    Problem using a macro from one workbook for a smilar purpose in another workbook

    Hello. A few days ago, someone assisted me in creating a macro that enabled me to copy certain cells from one sheet to another when a check box was ticked. Works like a charm.

    I have another workbook where I want to do something similar. I thought I could easily substitute spreadsheet names and cell ranges to make the same macro work here. But I've not been successful. Attached is a shell of the workbook I'm working on now. Check boxes are there. This time I have several sheets and want specific cells from any checked rows on any of the sheets to move to the "programs requested" sheet at the end. I tried doing it with the first sheet (Brockton) as a test and had no luck. Here is the language below....Getting run time errors, among others. FYI, the cells I would like moved over when checked are A,B,D,N,P,R and S.

    Could someone assist me?
    Thank you!


    Sub Brock()
    Dim rng As Range
    Dim crng As Range

    Set crng = Sheets("Brockton").Range("T3:T21")

    For Each cell In crng
    Set rng = Sheets("Programs requested").Range("A1").End(xlDown).Offset(1, 0)
    If cell.Value = True And Application.CountIf(Sheets("Brockton").Range("A:A"), cell.Offset(0, -7).Value) = 0 Then
    rng.Value = cell.Offset(0, -7)
    rng.Offset(0, 1).Value = cell.Offset(0, -6)
    rng.Offset(0, 2).Value = cell.Offset(0, -5)
    rng.Offset(0, 3).Value = cell.Offset(0, -4)
    rng.Offset(0, 4).Value = cell.Offset(0, -3)
    End If

    Next cell

    End Sub
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 3
    Last Post: 05-05-2012, 11:43 AM
  2. Problem with add a sheet to workbook macro
    By westonkw in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-24-2009, 10:45 AM
  3. Problem with closing workbook in macro
    By slm in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-10-2005, 09:05 PM
  4. Macro Name problem when I change workbook name?
    By Mike in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-26-2005, 10:06 AM
  5. [SOLVED] Problem executing a macro from different workbook where it is
    By Sergio Calleja in forum Excel General
    Replies: 1
    Last Post: 01-17-2005, 09:06 AM

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