ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Pasting into a row specified by a value in a cell (https://www.excelbanter.com/excel-programming/312781-pasting-into-row-specified-value-cell.html)

The Grinch[_13_]

Pasting into a row specified by a value in a cell
 

Hello All,

I have the following macro that copies & pastes some data from E93 to
C24...

Range("E93").Select
Range(Selection, Selection.End(xlDown)).Select
Application.CutCopyMode = False
Selection.Copy
Range("C24").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=True

There is a cell B13 that contains a number (positive integer <200). Is
there any way I can amend the macro such that instead of pasting the
data into cell C24 (as above) it pastes into row C and column number
specified by the value in B13.

For example, if B13=68 then the macro pastes the data into C68.

Any suggestions/comments appreciated.

CHEERS


--
The Grinch
------------------------------------------------------------------------
The Grinch's Profile: http://www.excelforum.com/member.php...fo&userid=2449
View this thread: http://www.excelforum.com/showthread...hreadid=267170


Rob van Gelder[_4_]

Pasting into a row specified by a value in a cell
 

Sub test()
Dim i As Long, rngSource As Range, rngDest As Range

Set rngSource = Range("E93")
Set rngSource = Range(rngSource, rngSource.End(xlDown))
i = Range("B13").Value
Set rngDest = Range("C" & i)

rngSource.Copy
rngDest.PasteSpecial Paste:=xlPasteValues, Transpose:=True
' Application.CutCopyMode = False
End Sub


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"The Grinch" wrote in message
...

Hello All,

I have the following macro that copies & pastes some data from E93 to
C24...

Range("E93").Select
Range(Selection, Selection.End(xlDown)).Select
Application.CutCopyMode = False
Selection.Copy
Range("C24").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=True

There is a cell B13 that contains a number (positive integer <200). Is
there any way I can amend the macro such that instead of pasting the
data into cell C24 (as above) it pastes into row C and column number
specified by the value in B13.

For example, if B13=68 then the macro pastes the data into C68.

Any suggestions/comments appreciated.

CHEERS


--
The Grinch
------------------------------------------------------------------------
The Grinch's Profile:
http://www.excelforum.com/member.php...fo&userid=2449
View this thread: http://www.excelforum.com/showthread...hreadid=267170





All times are GMT +1. The time now is 06:14 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com