Transfer data from one form to another.

Pojzon

New Member
Joined
May 19, 2017
Messages
19
Hello, I've got something like this:
9EKrdAb.jpg


I would like to transfer data from left part of picture into right part format. Name is always first and under it are listed tasks, amount of tasks is never the same. I would prefer non VBA solution if possible. Thank you for any help.
 
Last edited:

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
it cannot be done without vba:

Code:
Sub aParseMacro1()
Dim vNum, vDate, vName, vTask, vVal
Dim shtSrc As Worksheet, shtTarg As Worksheet
Dim vPrevNum, vDte
Dim colDtes As New Collection
Dim colVals As New Collection
Dim iCols As Integer, i As Integer


Set shtSrc = ActiveSheet
Sheets.Add
Set shtTarg = ActiveSheet
shtSrc.Activate


Range("c1").Select
While LCase(ActiveCell.Value) <> "sum"
   iCols = iCols + 1
   vDte = ActiveCell.Value
   colDtes.Add vDte
   ActiveCell.Offset(0, 1).Select  'next column
Wend


Range("B2").Select
While ActiveCell.Value <> ""
   If Not IsEmpty(ActiveCell.Offset(0, -1).Value) Then vNum = ActiveCell.Offset(0, -1).Value
   
   If vPrevNum <> vNum Then
      vName = ActiveCell.Value
   Else
      vTask = ActiveCell.Value
        'collect vals
      Set colVals = New Collection
      For i = 1 To iCols
          colVals.Add ActiveCell.Offset(0, i).Value
      Next
        
        'post data
      shtTarg.Activate
      For i = 1 To iCols
          ActiveCell.Offset(0, 0).Value = vName
          ActiveCell.Offset(0, 1).Value = colDtes(i)
          ActiveCell.Offset(0, 2).Value = vTask
          ActiveCell.Offset(0, 3).Value = colVals(i)
          
          ActiveCell.Offset(1, 0).Select  'next row
      Next


      shtSrc.Activate
   End If
   
   
   vPrevNum = vNum
   ActiveCell.Offset(1, 0).Select  'next row
Wend
shtTarg.Activate


Set shtSrc = Nothing
Set shtTarg = Nothing
Set colDtes = Nothing
End Sub
 
Upvote 0
Thank you for help. After trying macro I'm getting this:
SYIAvO5.jpg


That's not exactly what I need. I can copy-paste Name and Date manually no problem, I just need some automation with transfering correct tasks. Help columns are not a problem if it could solve something.
 
Upvote 0

Forum statistics

Threads
1,214,915
Messages
6,122,212
Members
449,074
Latest member
cancansova

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top