Good Morning,
I am trying to copy data that looks like the following
<tbody>
</tbody>
I want to make the data look like below. I need the macro to select only four of the columns for one sheet and three for the other,
and transpose the data leaving a space in between going vertical. To select which sheet it is going to
I want to select from the overall rating column, it will need to have a 7 or 6 to go to one page and a 1 or 2
to go to the other page. I have used the code from the following page:http://www.mrexcel.com/forum/excel-...-rows-paste-transpose-into-single-column.html
Sub SubbyWays()
'eaxample at http://www.mrexcel.com/forum/excel-...-rows-paste-transpose-into-single-column.html
Dim sData As Variant
Dim f_Data As Variant
Dim iC As Integer
Dim iR As Long
Dim rCoun As Long
Dim UCol As Integer
rCoun = 1
'Insert If statement to find top 2
sData = Range("A1").CurrentRegion.Value 'retrieves all values in the current row and stores in sdata
UCol = UBound(sData, 2) 'Ucol is set to equal Ubound(array name,Dimension) gives the upper boundry of the 2nd dimenson which would be how many colums are there.
ReDim f_Data(1 To UBound(sData, 1) * UCol, 1 To 1)
For iR = LBound(sData, 1) To UBound(sData, 1)
For iC = LBound(sData, 2) To UBound(sData, 2)
f_Data(rCoun, 1) = sData(Int((iC - 1) / UCol) + iR, 1 + ((iC - 1) Mod UCol))
rCoun = rCoun + 1
Next
Next iR
Range("H1").Resize(UBound(f_Data), 1) = f_Data
End Sub
How do I insert a loop to make sure for "SheetA" I get only the rows that have a 7 or 6
in the overall rating column? SheetB will have data that has a 1 or 2. Both sheets will have data transposed like in the example.
<tbody>
</tbody>
I am trying to copy data that looks like the following
Is there a problem | Name | Account number | Comments | Overall rating | Date |
yes | Jim | 1234 | Need to do this | 7 | 20140312 |
no | Jill | 5678 | This needs to be fixed | 6 | 20140414 |
yes | Bob | 4321 | Excellent works great | 1 | 20140313 |
no | Joe | 3214 | Excellent works great | 2 | 20140215 |
yes | Mike | 4123 | Need to do this | 7 | 20140617 |
no | Dan | 4213 | This needs to be fixed | 6 | 20140712 |
yes | Janet | 1111 | Excellent works great | 1 | 20140818 |
no | Jumior | 1112 | Excellent works great | 2 | 20140919 |
<tbody>
</tbody>
I want to make the data look like below. I need the macro to select only four of the columns for one sheet and three for the other,
and transpose the data leaving a space in between going vertical. To select which sheet it is going to
I want to select from the overall rating column, it will need to have a 7 or 6 to go to one page and a 1 or 2
to go to the other page. I have used the code from the following page:http://www.mrexcel.com/forum/excel-...-rows-paste-transpose-into-single-column.html
Sub SubbyWays()
'eaxample at http://www.mrexcel.com/forum/excel-...-rows-paste-transpose-into-single-column.html
Dim sData As Variant
Dim f_Data As Variant
Dim iC As Integer
Dim iR As Long
Dim rCoun As Long
Dim UCol As Integer
rCoun = 1
'Insert If statement to find top 2
sData = Range("A1").CurrentRegion.Value 'retrieves all values in the current row and stores in sdata
UCol = UBound(sData, 2) 'Ucol is set to equal Ubound(array name,Dimension) gives the upper boundry of the 2nd dimenson which would be how many colums are there.
ReDim f_Data(1 To UBound(sData, 1) * UCol, 1 To 1)
For iR = LBound(sData, 1) To UBound(sData, 1)
For iC = LBound(sData, 2) To UBound(sData, 2)
f_Data(rCoun, 1) = sData(Int((iC - 1) / UCol) + iR, 1 + ((iC - 1) Mod UCol))
rCoun = rCoun + 1
Next
Next iR
Range("H1").Resize(UBound(f_Data), 1) = f_Data
End Sub
How do I insert a loop to make sure for "SheetA" I get only the rows that have a 7 or 6
in the overall rating column? SheetB will have data that has a 1 or 2. Both sheets will have data transposed like in the example.
SheetA<o | SheetB<o | |||
Other purpose<o | ||||
Other purpose<o | <o | Other purpose<o | ||
Name <o | Jim <o | Name <o | Jumior<o | |
Account number <o | 1234<o | Account number <o | 1112<o | |
Comments<o | Need to do this <o | Comments<o | Excellent works great <o | |
Overall rating <o | 7<o | |||
Other purpose<o | ||||
Other purpose<o | ||||
Name <o | Janet<o | |||
Other purpose<o | Account number <o | 1111<o | ||
Other purpose<o | <o | Comments<o | Excellent works great <o | |
Name <o | Jill<o | |||
Account number <o | 5678<o | |||
Comments<o | This needs to be fixed <o | Other purpose<o | ||
Overall rating <o | 6<o | Name <o | Joe<o | |
Other Purpose<o | Account number <o | 3214<o | ||
Comments<o | Excellent works great<o | |||
Other purpose<o | <o | |||
Other Purpose<o | Other purpose<o | |||
Name <o | Bob<o | Name <o | Bob<o | |
Account number <o | 4321<o | Account number <o | 4321<o | |
Comments<o | Excellent works great <o | Comments<o | Excellent works great <o | |
Overall rating <o | 1<o | |||
Other Purpose<o |
<tbody>
</tbody>