Copy a cell value and paste into another column into 25 cells

waqar1239

New Member
Joined
Mar 26, 2017
Messages
27
Hello Team,
I am have data int two columns(A & B). And I want to see the data in column A and if it starts "#" then past in the new cloumn C frm C1:C25 and chck again the data at Column A(A26, now) if it start from "#" again paste the A26 Value t column C from C26 to C50 and same way i ave to do for A9000.Also I want in column D i want to put 1 to 25 no against each cell of Column C.

I can exlain anther way,I have two Col A & B.Every 25 clumn starts wth # in column A. I want to copy the# value cell A d paste into anoter column C and to 25 cells.

Column A
#998 (Copy this one and paste this into Column C for 25 times as mentioned below & in colum D put 1 to 25 no as mentioned below)

1 CREATE POINT 735MCC1:ET0401D.PNT

1 PUT POINT 735MCC1:ET0401D.PNT TYPE FLOAT
Value
Value
Value
Value
Value
Value
Value
Value
Value
Value
Value
Value
Value
Value
Value
Value
Value
Value
Value
Value
Value
Value
Column B
DESC = "735MCC1 DEVICE POWER 2-2"
AUDITUPD = NO
COLLECTOR = srhs14
COLMETH = CONNECTED
ENGUNITS = V
EXPORT = NO
FFREQUNITS = SECONDS
FASTFREQ = 2
HIRANGE = 30.00000000
INITSTATE = ON
LORANGE = 0.00000000
MXSAMUNITS = SECONDS
MXSAMTIME = 3600
NAMEINCOL = 735MCC1:ET0401D.PNT
NUMELEMS = 1
READDELTA = 0.10000000
RSTRTSTATE = PREVIOUS
SFREQUNITS = SECONDS
SLOWFREQ = 2
SIZE = 4
TRGCHANGE = NO
Value
Value
Value
Value

Column C
#998
#998
#998
#998
#998
#998
#998
#998
#998
#998
#998
#998
#998
#998
#998
#998
#998
#998
#998
#998
#998
#998
#998
#998
#998


<tbody>
</tbody>
Column D
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

<tbody>
</tbody>


Please help me
Cheers
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
waqar1239,

Try this....

Code:
Sub wakar1239()
Application.ScreenUpdating = False
On Error GoTo Done
For r = 1 To 10000 Step 25
If Not Left(Cells(r, 1).Text, 1) = "#" Then GoTo Done
i = r + 24
Range(Cells(r, 3), Cells(i, 3)) = Cells(r, 1)
Cells(i, 4) = 25
Set MyRange = Range(Cells(r, 4), Cells(i - 1, 4))
MyRange.Formula = "=MOD(ROW(),25)"
MyRange.Formula = MyRange.Value
Next r
Done:
Application.ScreenUpdating = True
End Sub

Hope that helps.
 
Upvote 0
Try this

Code:
Sub Copy_cell_value()
    For i = 1 To Range("A" & Rows.Count).End(xlUp).Row Step 25
        Range("C" & i).Resize(25).Value = Range("A" & i).Value
        Range("D" & i).Value = 1
        Range("D" & i & ":D" & i + 24).DataSeries Rowcol:=xlColumns, Type:=xlLinear, Date:=xlDay, Step:=1, Trend:=False
    Next
End Sub
 
Upvote 0
I'm glad to help you. Thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,067
Messages
6,122,949
Members
449,095
Latest member
nmaske

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