Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Static Chart Data Range | Charts and Charting in Excel | |||
Static Range Reference | Excel Discussion (Misc queries) | |||
How to put a STATIC version of a range of cells into an Outlook em | Excel Discussion (Misc queries) | |||
Dynamic data, static range, not updating. | Charts and Charting in Excel | |||
Static copy of spreadsheet | Excel Programming |