
transfering data from one sheet to another
Chris,
you are using variable "b" without defining a value. From
your explanation it would appear that you need to add a
line that reads:
b=a-4
also, you will have 597 source rows and 593 destination
rows.
you will strike some probs.
also, good practice is to follow naming conventions for
your variables, but I am pretty slack about it.
Steve
Quote:
>-----Original Message-----
>Hi
>I would like one sheet in my workbook to equal another
>sheet but not in the exact order.
>example
>' Dim a As Integer
>' Dim b As Integer
>'
> For a = 8 To 600
> With Sheets("Inventory")
> .Cells(a, 1) = Sheets("Main Database").Cells(b,
>2).Value ' BottleID
> .Cells(a, 2) = Sheets("Main Database").Cells(b,
>11).Value ' Isotope
> .Cells(a, 3) = Sheets("Main Database").Cells(b,
>5).Value ' Reference Date
> .Cells(a, 4) = Sheets("Main Database").Cells(b,
>6).Value ' Original uCi
> .Cells(a, 6) = Sheets("Main Database").Cells(b,
>14).Value ' #Days Of Days
> .Cells(a, 7) = Sheets("Main Database").Cells(b,
>15).Value ' Half-Life
> .Cells(a, 8) = Sheets("Main Database").Cells(b,
>16).Value ' Decay Fraction
> .Cells(a, 9) = Sheets("Main Database").Cells(b,
>17).Value ' Remaining Activity
>I do not want the formulas in the sheet itself because it
>could be deleted by the user. I want it in source code.
>that way it is always updated and can not be manipulated
>in anyway unless the code is changed. The above code did
>not work for me, what other way can it be done or how can
>I make my code preform the right task. Also this is for
a
>range of rows 4 to 600(Main Database) to 8 to 600
>(inventory).
>thank you
>chris
>.