M
M
Please see the posts below. I am having trouble assiging
values to (i,j). I have the desired column value in cell
maint!i5 and the row value in cell maint!i6. I changed
the formula below to reflect this...
i = maint!i5
j = maint!i6
....but am still having trouble. Can anyone help?
Thanks
**************************************************
I'm not sure how you got the location of that cell, but
once you know what it
is, you can just assign values instead of
selecting|copy|pasting.
This might give you an idea:
Option Explicit
Sub testme()
Dim RngToCopy As Range
Dim i As Long
Dim j As Long
Set RngToCopy = Selection
i = 12 'however you got it
j = 10 'however you got it, too
Worksheets("site nat gas").Cells(i, j) _
.Resize(RngToCopy.Rows,
RngToCopy.Columns).Value _
= RngToCopy.Value
End Sub
values to (i,j). I have the desired column value in cell
maint!i5 and the row value in cell maint!i6. I changed
the formula below to reflect this...
i = maint!i5
j = maint!i6
....but am still having trouble. Can anyone help?
Thanks
**************************************************
I'm not sure how you got the location of that cell, but
once you know what it
is, you can just assign values instead of
selecting|copy|pasting.
This might give you an idea:
Option Explicit
Sub testme()
Dim RngToCopy As Range
Dim i As Long
Dim j As Long
Set RngToCopy = Selection
i = 12 'however you got it
j = 10 'however you got it, too
Worksheets("site nat gas").Cells(i, j) _
.Resize(RngToCopy.Rows,
RngToCopy.Columns).Value _
= RngToCopy.Value
End Sub