Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Clear data range, and copy static value.

1. How do I clear out a range of data that starts at B4 and goes down
the column...how would I put this in a loop?

' Clear column B starting at B4 ....
.Range("b4:b" & .Cells(Rows.Count,
"B").End(xlUp).Row).ClearContents

2. How do I copy (paste special) a cell on a worksheet and run it
through a loop to populate the rest of some cells?
Example: I11 = vlookup....... -- but displays RW1111
I want to copy that to E9 and down the rest of the column to correspond
to some other data I have there, but I can't get it to copy the
RW1111...it keeps coming up with a zero due to the vlookup I
suppose....any help?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default Clear data range, and copy static value.

Hi,

1. This code clears a column (B) from B4 to the last row (the variable
Lastrow is the row number of the last row in the column) so no need to loop.

2. To copy the value (as opposed to the formula) use something like:

Range("I11").Copy
Range("E9").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False

If you want to copy I11 to a range of cells then one way is:

Range("I11").copy
For r=1 to 10
Range("E" & r).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
next r

OR

Range("I11").copy
Range("E1:E10").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False

HTH

" wrote:

1. How do I clear out a range of data that starts at B4 and goes down
the column...how would I put this in a loop?

' Clear column B starting at B4 ....
.Range("b4:b" & .Cells(Rows.Count,
"B").End(xlUp).Row).ClearContents

2. How do I copy (paste special) a cell on a worksheet and run it
through a loop to populate the rest of some cells?
Example: I11 = vlookup....... -- but displays RW1111
I want to copy that to E9 and down the rest of the column to correspond
to some other data I have there, but I can't get it to copy the
RW1111...it keeps coming up with a zero due to the vlookup I
suppose....any help?


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
Static Chart Data Range Bandit292 Charts and Charting in Excel 2 May 18th 10 08:39 AM
Static Range Reference [email protected] Excel Discussion (Misc queries) 2 January 31st 09 04:57 AM
How to put a STATIC version of a range of cells into an Outlook em Jane0218 Excel Discussion (Misc queries) 2 April 21st 08 07:43 PM
Dynamic data, static range, not updating. Mike K Charts and Charting in Excel 2 June 8th 06 05:07 PM
Static copy of spreadsheet No Name Excel Programming 1 June 11th 04 09:37 PM


All times are GMT +1. The time now is 03:54 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"