+ Reply to Thread
Results 1 to 2 of 2

help with copying cells if certain condition are met

  1. #1
    Registered User
    Join Date
    chechire UK
    MS-Off Ver
    Excel 2007

    help with copying cells if certain condition are met

    Hi All
    I'm having trouble copying data to a spcified range from a data sheet to a summary sheet

    To start i have set a condition where the user of my sheet can define which cells need copying accross by entering a specific value in a cell (lets say it references fiscal quarter 1 2 3 or 4) - from here i'm trying to create a macro which copies the data that is referenced in quarter1 if cell B1 in the summary sheet = 1 and the column in the data sheet contains 1 (under the column header Quarter).

    I then need to pull 2 cells across which are in the same row as any cells in column B that contain the value 1

    heres the code i'm using

    Sub Macro1()

    Dim count As Integer
    count = Sheets("summary").Range("A2").Value
    While count < 100
    If Sheets("data").Range("b" & count).Value = 1 Then
    Sheets("summary").range("F" & count).Value = Sheets("data").Range("d" & count).Value

    End If
    count = count + 1
    End Sub

    The data copies across ok but my problem is where i "put" the copied value (i think it's because i'm using the ("A2") as a reference point for the count.

    I dont know how to specify the exact cell (or range) where i copy the data across

    Any ideas ????? :-)

  2. #2
    Forum Expert Mordred's Avatar
    Join Date
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010

    Re: help with coping cells if certain condition are met

    Hi scott.hann and welcome to the forum. Please take a moment to read the forum rules located here and wrap your code in code tags as per rule #3. Once you do that, someone will be able to help you.
    If you're happy with someone's help, click that little star at the bottom left of their post to give them Reps.

    ---Keep on Coding in the Free World---

+ Reply to Thread

Thread Information

Users Browsing this Thread

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


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