Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default 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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copying cell contents from many cells and pasting into one cell MDN Excel Discussion (Misc queries) 7 December 10th 07 08:56 PM
Pasting a picture in a cell wnfisba Excel Discussion (Misc queries) 1 May 6th 07 05:50 PM
pasting content of cell into URL slushnee Excel Discussion (Misc queries) 3 September 4th 06 02:59 PM
Pasting on Filtered Data Sheets without pasting onto hidden cells CCSMCA Excel Discussion (Misc queries) 1 August 28th 05 01:22 PM
Pasting numbers and formulas without pasting format. Dan Excel Discussion (Misc queries) 3 March 27th 05 03:47 AM


All times are GMT +1. The time now is 07:50 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"