Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
jct jct is offline
external usenet poster
 
Posts: 4
Default Odd fill down formula macro question

I've searched for a solution similar to my dilema, but have not yet found
it.... I'm trying to set up a macro to take an exported spreadsheet from our
company software and modify it so the data can be easily analyzed with a
pivot table. The data exports like it would print the report, so there are
blank cells, like such:

Col A Col B Col C
New Park
Alarms 4253
Appliances 5457
Flooring 5487
Oak Park 2
Alarms 3578
Cabinet Supplier 4872


What I'd like to accomplish is this:

Step 1
Insert a column before Col A (making Col A now Col B)

Step 2
Copy (what is now) B2 to A2

Step 3
Insert a fomula to populate data from Col B into Col A, such as
= If(IsBlank(B3),A2,B3)
then fill down Col A, with the following results:

Col A Col B Col C Col D
New Park New Park
New Park Alarms 4253
New Park Appliances 5457
New Park Flooring 5487
Oak Park 2 Oak Park 2
Oak Park 2 Alarms 3578
Oak Park 2 Cabinet Supplier 4872

With this, I can then use a pivot table to analyze data in Cols A, C & D.

I don't have a pre-defined range for the exported report. Problem with my
formula is that it won't detect the end of the data, but will continue
filling in Col A. The report exports with blank cells in each column. How can
I automate the steps outlined above and identify where to end the macro?

Thanks much!
JCT

PS - I've tried to simulate the data in columns. If it doesn't come across
clearly, let me know. I'm open to another solution. I just need to be able to
analyze the exported data. Thx.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 77
Default Odd fill down formula macro question

So I think your prob is the length of your sheet changes..so fill down
doesn't work necessarily. Sometimes what I'll do is dim the length of
the sheet like this.
Lets say you have a formula in cell A2 that you want copied down.

Range("Z1").Formula = "=COUNTA(A:A)"
Dim LengthofSheet
LengthofSheet = Range("Z1").Text

Range("a2").Copy
Range("a3:a" & LengthofSheet).Select
ActiveSheet.Paste

Good luck!
-Mike

*** Sent via Developersdex http://www.developersdex.com ***
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 903
Default Odd fill down formula macro question

Why do you need to create another column. You can use fill down
or an equivalent macro to copy the populated cells in column A down.
Replicate values into blank cells (#fill_empty)
http://www.mvps.org/dmcritchie/excel...htm#fill_empty
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"jct" wrote in message ...
I've searched for a solution similar to my dilema, but have not yet found
it.... I'm trying to set up a macro to take an exported spreadsheet from our
company software and modify it so the data can be easily analyzed with a
pivot table. The data exports like it would print the report, so there are
blank cells, like such:

Col A Col B Col C
New Park
Alarms 4253
Appliances 5457
Flooring 5487
Oak Park 2
Alarms 3578
Cabinet Supplier 4872


What I'd like to accomplish is this:

Step 1
Insert a column before Col A (making Col A now Col B)

Step 2
Copy (what is now) B2 to A2

Step 3
Insert a fomula to populate data from Col B into Col A, such as
= If(IsBlank(B3),A2,B3)
then fill down Col A, with the following results:

Col A Col B Col C Col D
New Park New Park
New Park Alarms 4253
New Park Appliances 5457
New Park Flooring 5487
Oak Park 2 Oak Park 2
Oak Park 2 Alarms 3578
Oak Park 2 Cabinet Supplier 4872

With this, I can then use a pivot table to analyze data in Cols A, C & D.

I don't have a pre-defined range for the exported report. Problem with my
formula is that it won't detect the end of the data, but will continue
filling in Col A. The report exports with blank cells in each column. How can
I automate the steps outlined above and identify where to end the macro?

Thanks much!
JCT

PS - I've tried to simulate the data in columns. If it doesn't come across
clearly, let me know. I'm open to another solution. I just need to be able to
analyze the exported data. Thx.



  #4   Report Post  
Posted to microsoft.public.excel.programming
jct jct is offline
external usenet poster
 
Posts: 4
Default Odd fill down formula macro question

Hey, that's a handy tool I wasn't aware of! (Fumbling my way through
programming... but eager to learn more). I'll give it a try.

Thank you.

"David McRitchie" wrote:

Why do you need to create another column. You can use fill down
or an equivalent macro to copy the populated cells in column A down.
Replicate values into blank cells (#fill_empty)
http://www.mvps.org/dmcritchie/excel...htm#fill_empty
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"jct" wrote in message ...
I've searched for a solution similar to my dilema, but have not yet found
it.... I'm trying to set up a macro to take an exported spreadsheet from our
company software and modify it so the data can be easily analyzed with a
pivot table. The data exports like it would print the report, so there are
blank cells, like such:

Col A Col B Col C
New Park
Alarms 4253
Appliances 5457
Flooring 5487
Oak Park 2
Alarms 3578
Cabinet Supplier 4872


What I'd like to accomplish is this:

Step 1
Insert a column before Col A (making Col A now Col B)

Step 2
Copy (what is now) B2 to A2

Step 3
Insert a fomula to populate data from Col B into Col A, such as
= If(IsBlank(B3),A2,B3)
then fill down Col A, with the following results:

Col A Col B Col C Col D
New Park New Park
New Park Alarms 4253
New Park Appliances 5457
New Park Flooring 5487
Oak Park 2 Oak Park 2
Oak Park 2 Alarms 3578
Oak Park 2 Cabinet Supplier 4872

With this, I can then use a pivot table to analyze data in Cols A, C & D.

I don't have a pre-defined range for the exported report. Problem with my
formula is that it won't detect the end of the data, but will continue
filling in Col A. The report exports with blank cells in each column. How can
I automate the steps outlined above and identify where to end the macro?

Thanks much!
JCT

PS - I've tried to simulate the data in columns. If it doesn't come across
clearly, let me know. I'm open to another solution. I just need to be able to
analyze the exported data. Thx.




  #5   Report Post  
Posted to microsoft.public.excel.programming
jct jct is offline
external usenet poster
 
Posts: 4
Default Odd fill down formula macro question

David - This works great, and was an easy solution. Thanks for the resource.

"jct" wrote:

Hey, that's a handy tool I wasn't aware of! (Fumbling my way through
programming... but eager to learn more). I'll give it a try.

Thank you.

"David McRitchie" wrote:

Why do you need to create another column. You can use fill down
or an equivalent macro to copy the populated cells in column A down.
Replicate values into blank cells (#fill_empty)
http://www.mvps.org/dmcritchie/excel...htm#fill_empty
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"jct" wrote in message ...
I've searched for a solution similar to my dilema, but have not yet found
it.... I'm trying to set up a macro to take an exported spreadsheet from our
company software and modify it so the data can be easily analyzed with a
pivot table. The data exports like it would print the report, so there are
blank cells, like such:

Col A Col B Col C
New Park
Alarms 4253
Appliances 5457
Flooring 5487
Oak Park 2
Alarms 3578
Cabinet Supplier 4872


What I'd like to accomplish is this:

Step 1
Insert a column before Col A (making Col A now Col B)

Step 2
Copy (what is now) B2 to A2

Step 3
Insert a fomula to populate data from Col B into Col A, such as
= If(IsBlank(B3),A2,B3)
then fill down Col A, with the following results:

Col A Col B Col C Col D
New Park New Park
New Park Alarms 4253
New Park Appliances 5457
New Park Flooring 5487
Oak Park 2 Oak Park 2
Oak Park 2 Alarms 3578
Oak Park 2 Cabinet Supplier 4872

With this, I can then use a pivot table to analyze data in Cols A, C & D.

I don't have a pre-defined range for the exported report. Problem with my
formula is that it won't detect the end of the data, but will continue
filling in Col A. The report exports with blank cells in each column. How can
I automate the steps outlined above and identify where to end the macro?

Thanks much!
JCT

PS - I've tried to simulate the data in columns. If it doesn't come across
clearly, let me know. I'm open to another solution. I just need to be able to
analyze the exported data. Thx.






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 Formula palups Excel Worksheet Functions 1 January 20th 10 04:28 AM
Fill formula down using macro Charles Excel Discussion (Misc queries) 2 November 13th 08 02:05 AM
Fill formula question Meredith Excel Worksheet Functions 1 March 29th 05 11:19 AM
Fill Formula - Macro Cathy U Excel Discussion (Misc queries) 2 February 22nd 05 04:48 PM
Excel fill down formula recalculation question Dick Excel Programming 2 December 16th 03 06:28 PM


All times are GMT +1. The time now is 02:15 AM.

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"