Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default fill dowb using macro

I have the following spreadsheet that shows the following coluns A and B.
Cloumn A has a ref number whci needs to be inptu into Column B, however in
Column A where there is a 0 in the column below the ref number above it has
to be input into column B until you come to a different ref number in cloumn
A. for eg below.

A1 B1
1234 1234
0 1234
5678 5678
0 5678
0 5678
7881 7881
8992 8992
0 8992
Does anyone know how to achieve this automatically. I can do it using the If
statement but these can be massive files and are for inexperienced users so
i want to be able for them to run this auromatically by way of Macro if
possible.
Thanks in anticipation once again
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default fill dowb using macro

Real simple. Done this a thousand times before.

Sub FixColumns()

RowCount = 1
Do While Range("A" & RowCount) < ""
If Range("A" & RowCount) < 0 Then
RefNo = Range("A" & RowCount)
End If
Range("B" & RowCount) = RefNo

RowCount = RowCount + 1
Loop

End Sub


"tom_mcd" wrote:

I have the following spreadsheet that shows the following coluns A and B.
Cloumn A has a ref number whci needs to be inptu into Column B, however in
Column A where there is a 0 in the column below the ref number above it has
to be input into column B until you come to a different ref number in cloumn
A. for eg below.

A1 B1
1234 1234
0 1234
5678 5678
0 5678
0 5678
7881 7881
8992 8992
0 8992
Does anyone know how to achieve this automatically. I can do it using the If
statement but these can be massive files and are for inexperienced users so
i want to be able for them to run this auromatically by way of Macro if
possible.
Thanks in anticipation once again

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default fill dowb using macro

brilliant , thanks very much

"Joel" wrote:

Real simple. Done this a thousand times before.

Sub FixColumns()

RowCount = 1
Do While Range("A" & RowCount) < ""
If Range("A" & RowCount) < 0 Then
RefNo = Range("A" & RowCount)
End If
Range("B" & RowCount) = RefNo

RowCount = RowCount + 1
Loop

End Sub


"tom_mcd" wrote:

I have the following spreadsheet that shows the following coluns A and B.
Cloumn A has a ref number whci needs to be inptu into Column B, however in
Column A where there is a 0 in the column below the ref number above it has
to be input into column B until you come to a different ref number in cloumn
A. for eg below.

A1 B1
1234 1234
0 1234
5678 5678
0 5678
0 5678
7881 7881
8992 8992
0 8992
Does anyone know how to achieve this automatically. I can do it using the If
statement but these can be massive files and are for inexperienced users so
i want to be able for them to run this auromatically by way of Macro if
possible.
Thanks in anticipation once again

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
Macro Fill palups Excel Worksheet Functions 2 January 20th 10 04:55 AM
need macro for fill down tom_mcd[_2_] Excel Programming 1 August 2nd 09 01:30 PM
Macro to fill in 1 of 10 Bryan Excel Programming 6 June 24th 09 03:19 PM
Fill Macro II Mike Excel Worksheet Functions 0 February 6th 09 07:24 PM
Fill Down Macro Lost in Excel Excel Discussion (Misc queries) 7 December 8th 08 10:24 PM


All times are GMT +1. The time now is 09:16 AM.

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

About Us

"It's about Microsoft Excel"