LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Copy By Variable

This is one logical line.

Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False

The space character followed by the underscore character means that it's
continued on the next physical line.

zyus wrote:

Tried but pop op compile & syntax error and item highlighted as per below

Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,

"Faraz A. Qureshi" wrote:

You could use the following macro by:
1. Right click on the sheet tab at the bottom;
2. Selecting View Code;
3. Copy paste the following code:

Sub Macrox()
Dim x As Integer
Dim y As Integer
y = 1
Selection.Copy
x = ActiveCell.Offset(1, 0).Value
ActiveCell.Offset(2, 0).Select
Do Until x = y
ActiveCell.Offset(1, 0).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks:=False, Transpose:=False
y = y + 1
Loop
Application.CutCopyMode = False
End Sub

4. Now, CLICK/ACTIVATE cell where the value to be copied & pasted is present
(forexample A1). The number of times the cell is to be pasted is the cell
below it (in this example A2)
5. Go back to the sheet;
6. Press Alt+F8;
8. Select Macrox to be run;
9. Use it on any other column.

--
Do check "Yes" if this post is helpful,
Best Regards,

Faraz


"zyus" wrote:

I want to copy based on value in a cell

ex A1 value $100
A2 value 5
i exp that i could run some function to copy $100 five times in cell
A3,A4,A5,A6 & A7.

I have about 300 columns with different types of values

Thanks





--

Dave Peterson
 
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
Copy cells to variable number of rows Acct Supr - DCTC Excel Discussion (Misc queries) 5 September 26th 09 12:58 PM
copy cell from file with variable name hsg Excel Worksheet Functions 1 March 27th 09 08:12 PM
VBA help to copy variable range Eduardo Excel Discussion (Misc queries) 7 August 18th 08 09:16 PM
copy down with variable number of rows mohavv Excel Discussion (Misc queries) 5 November 15th 07 04:18 PM
Locating variable range to copy Eric C New Users to Excel 3 August 12th 05 10:23 AM


All times are GMT +1. The time now is 12:37 AM.

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"