transfer of row data to column

anandvarma

Active Member
Joined
Apr 26, 2011
Messages
384
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
dear all i have data set like this


b5 Staff Welfare
b6 Primary Cost Category
b7 RAIL - 1053
b8 Cash
b9 Staff Welfare
b10 Primary Cost Category
b11 RAIL - 1007

i need to transfer cell contents after Primary Cost Category i.e.B7 to C5

this sheet contain 8000 rows

help me
pvarma
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Dear all

I could able to workout using this formula

=IF(INDIRECT("B"&ROW()+1)="Primary Cost Category",INDIRECT("B"&ROW()+2),0)

can any body suggest better way for this

pvarma
 
Upvote 0
Is "b6 Primary Cost Category" in one cell?
 
Upvote 0
thank you for the interest shown

This formula have to be copies to 8000 rows. it should not be static, i have already posted the solution. can you update that with better one
 
Upvote 0
Hi again!
Have you inserted the formula from C5? (I think it works as required and not static)
Also you may use this VBA code
Code:
Sub find()
Dim a As Integer
For a = 5 To 8000
If Cells(a, 2).Value = "Primary Cost Category" Then
Cells(a, 2).Offset(-1, 1).Value = Cells(a, 2).Offset(1).Value
End If
Next a
End Sub
Hope this helps
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,600
Messages
6,179,833
Members
452,947
Latest member
Gerry_F

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