+ Reply to Thread
Results 1 to 5 of 5

Recognising data and converting data block to single row

  1. #1
    Registered User
    Join Date
    05-23-2018
    Location
    Australia
    MS-Off Ver
    2016
    Posts
    2

    Recognising data and converting data block to single row

    Hi, I'm very new to VBA coding so please be patient with me. I've been trying for Excel to recognize a date in Sheet1 and copy a block of data, then find the same date in Sheet2 and paste the copied data into one single row in line with that date, overwriting any data that might already exist in this row.

    Sheet1.PNG

    Sheet2.PNG

    The pictures show a simplified layout of the problem I'm trying to solve. Any help would be greatly appreciated.

  2. #2
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Recognising data and converting data block to single row

    It is more easy if you attach an Excel file.
    Where to put Shift2 data in sheet2 , always in column "W"
    - Battle without fear gives no glory - Just try

  3. #3
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Recognising data and converting data block to single row

    Is it what you want
    Adjust Constantes to your need

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    05-23-2018
    Location
    Australia
    MS-Off Ver
    2016
    Posts
    2

    Re: Recognising data and converting data block to single row

    Hi, this is exactly what I wanted to happen, thank you so much . Could I ask you to explain a few details about the code to me so I can apply it to my actual workbook, which is a little more complex than my example, but I'm actually not able to share it on here.

    Const S1Col As String = "B"
    Const S2Col As String = "W" ... does this section define the range of columns between which the data will be pasted in sheet2?

    WkDate = Sheets(WS1Name).Cells(1, 1)
    With Sheets(WS2Name)
    LR = .Cells(Rows.Count, 1).End(3).Row
    For I = 1 To LR + 1
    If (.Cells(I, 1) = WkDate) Then Exit For


    ... could you explain this section to me? I do apologise for my ignorance, like I said Im very new to this.

  5. #5
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Recognising data and converting data block to single row

    See here after
    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. [SOLVED] Converting a single row data into multiple Row Data
    By kumark in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 07-06-2015, 07:38 AM
  2. Converting a range of data into a single column
    By MrCD in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-25-2014, 12:00 PM
  3. Block of data into single column
    By marielouise1 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-04-2013, 03:22 AM
  4. Replies: 1
    Last Post: 05-23-2012, 05:49 AM
  5. Converting grouped data in multiple rows and columns to single row
    By learner_123 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-23-2012, 05:49 AM
  6. Replies: 5
    Last Post: 03-10-2009, 11:02 PM
  7. Converting an array of data into a single column
    By Raj in forum Excel General
    Replies: 0
    Last Post: 08-15-2006, 04:25 PM

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