+ Reply to Thread
Results 1 to 10 of 10

Copy data from one set of cells to another cells and repeat the process -sheet attach

  1. #1
    Registered User
    Join Date
    03-30-2011
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    17

    Copy data from one set of cells to another cells and repeat the process -sheet attach

    Hi I am fairly new to VBA. I have a sheet which has a data from column A10 to M67. Now I want this data to be copied to column Q9 (so Q9 should show data from cell A10) , after this I would like to leave 2 rows gap below and go to cell Q12 and get the data from A11 and repeat it till the columns A is blank.
    There has to be some simple way with either the formulas or macros but was not able to solve it.

    This means fill data on Q9 from A10, then go to Q12 and get data from A11.
    Q9=A10
    Q12=A11
    Q15=A12
    Q18=A13

    I have attached the spreadsheet and shown the example.
    Attached Files Attached Files
    Last edited by talhawahab; 03-31-2011 at 08:19 PM.

  2. #2
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Copy data from one set of cells to another cells and repeat the process -sheet at

    hi, talhawahab, please check attachment, run code "test"
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    03-30-2011
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    17

    Re: Copy data from one set of cells to another cells and repeat the process -sheet at

    Thanks Watersev...the code works brilliantly....I didn't understand what the code meant but does the job.
    I only had one issue with the code after the code is run. the two lines which are copied are identical in Q9 and Q10 and that is fine. The problem is the only difference the second line should have is: if 1st line (row9) have figures in Credit column (column W), there should be figures in Debit Column (column V) in row 10 and viceversa.

  4. #4
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Copy data from one set of cells to another cells and repeat the process -sheet at

    hi, sorry, I did miss that part, corrected, please check attachment.

    I assume in Debits and Credits columns we will always have one value and zero as a rule.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    03-30-2011
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    17

    Re: Copy data from one set of cells to another cells and repeat the process -sheet at

    Thanks Watersev now the code is perfect!....you have saved lot of my time and lots of stress!!! very thankful to you. fully solved! Dr and cr are fine now

  6. #6
    Registered User
    Join Date
    03-30-2011
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    17

    Re: Copy data from one set of cells to another cells and repeat the process -sheet at

    hi again...I have one small problem again...can you replace cell U10,U13,U16 (all second line) with one fix account number which would be in cell (P1).

  7. #7
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Copy data from one set of cells to another cells and repeat the process -sheet at

    Quote Originally Posted by talhawahab View Post
    hi again...I have one small problem again...can you replace cell U10,U13,U16 (all second line) with one fix account number which would be in cell (P1).
    hi, please check attachment, field "Job code" will remain empty as requested
    Attached Files Attached Files
    Last edited by watersev; 04-01-2011 at 03:44 AM.

  8. #8
    Registered User
    Join Date
    03-30-2011
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    17

    Re: Copy data from one set of cells to another cells and repeat the process -sheet at

    Thnks watersev again ....ur a gem...

  9. #9
    Registered User
    Join Date
    03-30-2011
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    17

    Re: Copy data from one set of cells to another cells and repeat the process -sheet at

    Hi again,
    I would like to get a quick help from you please. I have two issues but I think are small and I am stuck with it.

    First, if any (number/text) in cell U9, U12, U15, U18, U21 and so on is starting with "1" i.e (left("U9",1)="1") (for eg: 11210 or 1-6110) . if yes, Then delete that row (Q9:Y9) and one below (Q10:Y10) and repeat it but going --> going to U12.
    '(only do this in U9, U12, U15, U18, U21 and so on.
    'I had created the macro (macro name: clearing_line_which_has_1()
    see below or see in the attached spreadsheet.

    Please Login or Register  to view this content.
    The second issue is where the data is 'copied from left side to right, (cell Q9:Y9) at the bottom (cell u34)....12110 remains (in cell U34,U37,U40). I would like to get rid of those numbers.

    I would really appreciate if you can help me with this.
    Attached Files Attached Files

  10. #10
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Copy data from one set of cells to another cells and repeat the process -sheet at

    hi, talhawahab
    1. As far as I understand it's a separate task though it can be incorporated in "copy_data" (please advise if so). Sample of possible separate code:

    Please Login or Register  to view this content.
    2. I've amended the code "copy data" not to create those "empty" strings with account number from P1

    Please Login or Register  to view this content.
    If any outstanding issues or questions, please shout, best regards
    Last edited by watersev; 04-26-2011 at 04:08 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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