Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Copying varying values down through rows

Hi,

I'd like to copy values from a column down till a new value is encountered
and then start copying that down. Simple I'm sure but I can't seen to get a
start on it.


Here's what I have:

Column A Column B
Value 1 Number
Number
Number
Value 2 Number
Number


Here's what I'd like after running macro:

Column A Column B
Value 1 Number
Value 1 Number
Value 1 Number
Value 2 Number
Value 2 Number


Thanks for the help.


  #2   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: 102
Default Copying varying values down through rows

Steve,

Here's a method that uses a helper column (which can later be deleted)
Insert a blank column next to B (ie column C is blank)
In C1: = A1
In C2: = IF(A2="",C1,A2)
Copy C2 down for all of your data
Select Column C and Copy it
Paste Special (Values) into column A
Delete column C

Dan E

"Steve" wrote in message ...
Hi,

I'd like to copy values from a column down till a new value is encountered
and then start copying that down. Simple I'm sure but I can't seen to get a
start on it.


Here's what I have:

Column A Column B
Value 1 Number
Number
Number
Value 2 Number
Number


Here's what I'd like after running macro:

Column A Column B
Value 1 Number
Value 1 Number
Value 1 Number
Value 2 Number
Value 2 Number


Thanks for the help.




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Copying varying values down through rows

If I understand you, this should work. Select the range
you want to fill and run the macro.

***Make sure you do a back up first

Sub copyit()
Dim t As Integer, i As Integer
Dim rng As Range
Set rng = Selection
t = rng.Rows.Count
For i = 2 To t
If rng.Cells(i, 1) = "" Then
rng.Cells(i, 1) = rng.Cells(i - 1, 1)
End If
Next i
End Sub


-----Original Message-----
Hi,

I'd like to copy values from a column down till a new

value is encountered
and then start copying that down. Simple I'm sure but I

can't seen to get a
start on it.


Here's what I have:

Column A Column B
Value 1 Number
Number
Number
Value 2 Number
Number


Here's what I'd like after running macro:

Column A Column B
Value 1 Number
Value 1 Number
Value 1 Number
Value 2 Number
Value 2 Number


Thanks for the 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
Copying rows values on one sheet to part of a formula in a column Manosh Excel Discussion (Misc queries) 3 June 23rd 09 03:37 PM
Copying cells from varying rows annettek Excel Discussion (Misc queries) 2 May 25th 07 02:51 PM
Alternating shading of varying groups of rows AntDawg Excel Discussion (Misc queries) 3 July 16th 06 11:02 PM
SUMPRODUCT with varying # of rows Ren Excel Worksheet Functions 5 June 27th 06 11:28 PM
How do I ignore values while copying from hidden rows? Mayank Excel Worksheet Functions 1 July 19th 05 02:48 PM


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