Copy range from one sheet to another cell by cell

G

Georges

Dear all,
I would like to copy range C1:C70 from Sheet1 (variable on InputB; if B is
5 then C1:C5 and if B is 40 then C1:C40) and paste into Sheet2 on the place
of RB (see below), I mean RB should be that range.
so it shold be like this

Sheet2(D2) = C1
Sheet2(D102) = C2
Sheet2(D202) = C3
..
..
..
Sheet2(D"B"02) = C"B"

I don't know how to define that starting RB is cell C1 and that the next RB
is cell C2
Thanks in advance


Sub Makronaredba1()
'
' Makronaredba1 Makronaredba
'

B = InputBox("Insert number of copies", "Umetanje prostorija")
Sheets("Podloga gubici").Select
Range("A1:AJ100").Select
Selection.Copy
Sheets("GUBICI").Select
RB = 0
For I = 1 To B * 100 Step 100
If Cells(I, 1).Value = 0 Then
Cells(I, 1).Select
ActiveSheet.Paste
End If
Cells(I + 1, 4).Value = RB + 1
RB = RB + 1
Next I
End Sub
 
P

p45cal

I don't know that I understand what you want but could it be somethin
along these lines?:


VBA Code:
--------------------


Sub Makronaredba1()
B = InputBox("Insert number of copies", "Umetanje prostorija")
Set CColumnRng = Sheets("AnotherSheet").Range("C1:C" & B) 'I don't which sheet these cells are on
Sheets("Podloga gubici").Select
Range("A1:AJ100").Copy
Sheets("GUBICI").Select
RB = 0
For I = 1 To B * 100 Step 100
If Cells(I, 1).Value = 0 Then
Cells(I, 1).Select
ActiveSheet.Paste
End If
RB = RB + 1
Cells(I + 1, 4).Value = CColumnRng.Cells(RB).Value
Next I
End Sub
 
G

Georges

I don't know that I understand what you want but could it be something
along these lines?:


VBA Code:
--------------------



Sub Makronaredba1()
B = InputBox("Insert number of copies", "Umetanje prostorija")
Set CColumnRng = Sheets("AnotherSheet").Range("C1:C" & B) 'I don't which sheet these cells are on
Sheets("Podloga gubici").Select
Range("A1:AJ100").Copy
Sheets("GUBICI").Select
RB = 0
For I = 1 To B * 100 Step 100
If Cells(I, 1).Value = 0 Then
Cells(I, 1).Select
ActiveSheet.Paste
End If
RB = RB + 1
Cells(I + 1, 4).Value = CColumnRng.Cells(RB).Value
Next I
End Sub

Thnx, I will check it tonight...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top