VBA - copy cells from one sheet to another
Isis,
Something like this - the code just adds one to the value....
Sub TryNow()
Dim myR As Long
Dim myRCount As Long
Dim myC As Integer
Dim myCCount As Integer
myRCount = Worksheets("Sheet1"). _
Cells(Rows.Count, 1).End(xlUp).Row
myCCount = Worksheets("Sheet1"). _
Cells(1, Columns.Count).End(xlToLeft).Column
For myR = 1 To myRCount
For myC = 1 To myCCount
Worksheets("Sheet2").Cells(myR, myC).Value = _
Worksheets("Sheet1").Cells(myR, myC).Value + 1
Next myC
Next myR
End Sub
HTH,
Bernie
MS Excel MVP
"Isis" wrote in message
...
I want to copy from a sheet with data on to another empty sheet - I want to
loop through the rows of the first sheet one cell at a time, then write the
contents into the second empty sheet one cell at a time - I will be looking
to manipulate the data slightly before writing it back.
What I am asking for is the code to loop through the first sheet and the
code to write to the second, one cell at a time but also producing the same
number of rows in both sheets when finished - if that makes sense.
Thanks for any help
|