Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Len Len is offline
external usenet poster
 
Posts: 162
Default AutoFillDown

Hi,

I've a problem to auto fill down the data from active cell ( say B5 in
month1, B7 in month2 ) in column B if auto fill down function is to
depend on the availability of column A data
The active cell is used because the data is exported that can be
placed in any cell of column B
If I were to use the following codes in month1, it will give the
correct result in month 1 but not in month 2 because it defined the
obsolute cell reference, ie cell (5,1)& (5,2)
Dim rng As Range
Set rng = Range(Cells(5, 1), Cells(5, 1).End(xlDown)
rng.Offset(0, 1).Formula = Cells(5, 2).Formula

e.g.
Month 1 Month 2
A B A B
1 GLP5-00652 2,000.00 GLP5-00652 2,000.00
2 GLP5-00654 3,350.00 GLP5-00654 3,350.00
3 GLP5-00655 1,450.00 GLP5-00655 1,450.00
4 APP5-00312 906.00 APP5-00312 906.00
5 GLP5-01173 - GLP5-01173 453.00
6 APP5-00477 APP5-00477 21.00
7 GLP5-01077 GLP5-01077 -
8 GLP5-01087 GLP5-01087
9 APP5-00480 APP5-00480
10 APP5-00481 APP5-00481
11 APP5-00482 APP5-00482


Thus, how to set the excel VB code in order to give the correct result
that can be applied for both month1 & month2, i.e it should be as
follow : -
Month 1 Month 2
A B A B
1 GLP5-00652 2,000.00 GLP5-00652 2,000.00
2 GLP5-00654 3,350.00 GLP5-00654 3,350.00
3 GLP5-00655 1,450.00 GLP5-00655 1,450.00
4 APP5-00312 906.00 APP5-00312 906.00
5 GLP5-01173 - GLP5-01173 453.00
6 APP5-00477 - APP5-00477 21.00
7 GLP5-01077 - GLP5-01077 -
8 GLP5-01087 - GLP5-01087 -
9 APP5-00480 - APP5-00480 -
10 APP5-00481 - APP5-00481 -
11 APP5-00482 - APP5-00482 -

Please help.

Thanks in advance

Regards
Len

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default AutoFillDown

Len,
If I have understood correctly, will this do what you want?


Set rng = Range(Cells(Activecell.row, 1), Cells(Activecell.row 1).End(xlDown)
rng.Offset(0, 1).Formula = Cells(ActiveCell.row, 2).Formula


HTH

"Len" wrote:

Hi,

I've a problem to auto fill down the data from active cell ( say B5 in
month1, B7 in month2 ) in column B if auto fill down function is to
depend on the availability of column A data
The active cell is used because the data is exported that can be
placed in any cell of column B
If I were to use the following codes in month1, it will give the
correct result in month 1 but not in month 2 because it defined the
obsolute cell reference, ie cell (5,1)& (5,2)
Dim rng As Range
Set rng = Range(Cells(5, 1), Cells(5, 1).End(xlDown)
rng.Offset(0, 1).Formula = Cells(5, 2).Formula

e.g.
Month 1 Month 2
A B A B
1 GLP5-00652 2,000.00 GLP5-00652 2,000.00
2 GLP5-00654 3,350.00 GLP5-00654 3,350.00
3 GLP5-00655 1,450.00 GLP5-00655 1,450.00
4 APP5-00312 906.00 APP5-00312 906.00
5 GLP5-01173 - GLP5-01173 453.00
6 APP5-00477 APP5-00477 21.00
7 GLP5-01077 GLP5-01077 -
8 GLP5-01087 GLP5-01087
9 APP5-00480 APP5-00480
10 APP5-00481 APP5-00481
11 APP5-00482 APP5-00482


Thus, how to set the excel VB code in order to give the correct result
that can be applied for both month1 & month2, i.e it should be as
follow : -
Month 1 Month 2
A B A B
1 GLP5-00652 2,000.00 GLP5-00652 2,000.00
2 GLP5-00654 3,350.00 GLP5-00654 3,350.00
3 GLP5-00655 1,450.00 GLP5-00655 1,450.00
4 APP5-00312 906.00 APP5-00312 906.00
5 GLP5-01173 - GLP5-01173 453.00
6 APP5-00477 - APP5-00477 21.00
7 GLP5-01077 - GLP5-01077 -
8 GLP5-01087 - GLP5-01087 -
9 APP5-00480 - APP5-00480 -
10 APP5-00481 - APP5-00481 -
11 APP5-00482 - APP5-00482 -

Please help.

Thanks in advance

Regards
Len


  #3   Report Post  
Posted to microsoft.public.excel.programming
Len Len is offline
external usenet poster
 
Posts: 162
Default AutoFillDown

Hi,

Thanks, it works

Regards
Len

Toppers wrote:
Len,
If I have understood correctly, will this do what you

want?


Set rng = Range(Cells(Activecell.row, 1), Cells(Activecell.row

1).End(xlDown)
rng.Offset(0, 1).Formula = Cells(ActiveCell.row,

2).Formula


HTH

"Len" wrote:

Hi,

I've a problem to auto fill down the data from active cell ( say

B5 in
month1, B7 in month2 ) in column B if auto fill down function is to
depend on the availability of column A data
The active cell is used because the data is exported that can be
placed in any cell of column B
If I were to use the following codes in month1, it will give the
correct result in month 1 but not in month 2 because it defined the
obsolute cell reference, ie cell (5,1)& (5,2)
Dim rng As Range
Set rng = Range(Cells(5, 1), Cells(5, 1).End(xlDown)
rng.Offset(0, 1).Formula = Cells(5, 2).Formula

e.g.
Month 1 Month 2
A B A B
1 GLP5-00652 2,000.00 GLP5-00652 2,000.00
2 GLP5-00654 3,350.00 GLP5-00654 3,350.00
3 GLP5-00655 1,450.00 GLP5-00655 1,450.00
4 APP5-00312 906.00 APP5-00312 906.00
5 GLP5-01173 - GLP5-01173 453.00
6 APP5-00477 APP5-00477 21.00
7 GLP5-01077 GLP5-01077 -
8 GLP5-01087 GLP5-01087
9 APP5-00480 APP5-00480
10 APP5-00481 APP5-00481
11 APP5-00482 APP5-00482


Thus, how to set the excel VB code in order to give the correct

result
that can be applied for both month1 & month2, i.e it should be as
follow : -
Month 1 Month 2
A B A B
1 GLP5-00652 2,000.00 GLP5-00652 2,000.00
2 GLP5-00654 3,350.00 GLP5-00654 3,350.00
3 GLP5-00655 1,450.00 GLP5-00655 1,450.00
4 APP5-00312 906.00 APP5-00312 906.00
5 GLP5-01173 - GLP5-01173 453.00
6 APP5-00477 - APP5-00477 21.00
7 GLP5-01077 - GLP5-01077 -
8 GLP5-01087 - GLP5-01087 -
9 APP5-00480 - APP5-00480 -
10 APP5-00481 - APP5-00481 -
11 APP5-00482 - APP5-00482 -

Please help.

Thanks in advance

Regards
Len



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



All times are GMT +1. The time now is 11:27 PM.

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"