Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 90
Default Copy or Fill Down Macro?

I have a spreadsheet that was sent to me that lists Store Numbers, Item
Descriptions and QTY sold. The Spread sheet is 25000 lines long. The problem
i am coming across is the store number cells are merged together. When
unmerge the cells only the first Descrption next to the store number has a
store number associated with it. And everyone below it had a blank cell. So
the data is useless to me in Access because I need to have a store number for
each description. Is there a macro i can create or run that will paste the
first number in the column all the way down and then once is hits a new or
different store number it copies that number and pastes it in all the empty
cells below that, finds the next change in number, copies it and pastes....so
on and so forth. So the end result is there is a corresponding store number
with each product description.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 638
Default Copy or Fill Down Macro?

One way. This will cycle through column A and fill blank cells with
the value from the previous cell until the last used row in the
spreadsheet is reached. Test on copy of data before running on
production data to make certain this is what you are after.
Sub this()
lRow = Cells.Find(what:="*", After:=[A1], _
SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious).Row
For i = 1 To lRow
If Trim(Cells(i, 1).Offset(1)) = "" Then _
Cells(i, 1).Offset(1) = Cells(i, 1)
Next i
End Sub
Chuck wrote:
I have a spreadsheet that was sent to me that lists Store Numbers, Item
Descriptions and QTY sold. The Spread sheet is 25000 lines long. The problem
i am coming across is the store number cells are merged together. When
unmerge the cells only the first Descrption next to the store number has a
store number associated with it. And everyone below it had a blank cell. So
the data is useless to me in Access because I need to have a store number for
each description. Is there a macro i can create or run that will paste the
first number in the column all the way down and then once is hits a new or
different store number it copies that number and pastes it in all the empty
cells below that, finds the next change in number, copies it and pastes....so
on and so forth. So the end result is there is a corresponding store number
with each product description.


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default Copy or Fill Down Macro?

Assume your store number is in column A and you have contiguous data
in column B (I think that is what you mean after you unmerge the
cells), then highlight the cells in column A down to the bottom of
your data in B. Then press F5 (GoTo), click on Special and click on
Blanks. Only the blank cells in column A will now be highlighted, with
the active cell being the first empty cell. Then begin a formula by
typing = and then click in the cell above the active cell, then press
CTRL-Enter together. This will put that formula in every blank cell.

You can then highlight column A, click <copy, then Edit | Paste
Special | Values (check) | OK then <Enter in order to fix the values.

Hope this helps.

Pete

On Oct 8, 6:50 pm, Chuck wrote:
I have a spreadsheet that was sent to me that lists Store Numbers, Item
Descriptions and QTY sold. The Spread sheet is 25000 lines long. The problem
i am coming across is the store number cells are merged together. When
unmerge the cells only the first Descrption next to the store number has a
store number associated with it. And everyone below it had a blank cell. So
the data is useless to me in Access because I need to have a store number for
each description. Is there a macro i can create or run that will paste the
first number in the column all the way down and then once is hits a new or
different store number it copies that number and pastes it in all the empty
cells below that, finds the next change in number, copies it and pastes....so
on and so forth. So the end result is there is a corresponding store number
with each product description.



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 90
Default Copy or Fill Down Macro?

Column A is Store Number. And Column B is Descriptions of products sold in
that store. So an example would be A2-A200 is merged and it will say Store
100. And each cell from B2 to B200 will have a different Item description in
it that was sold in store 100. Now if i Unmerge Cell A2-A200 it will put 100
in Cell A2 and leave blanks down to Cell A200. I need to fill then with the
number 100 then When it hits Cell A201 which has a value of 110 in it to copy
that number and paste it from cell A202 down to whenever the store number
changes again.

"Pete_UK" wrote:

Assume your store number is in column A and you have contiguous data
in column B (I think that is what you mean after you unmerge the
cells), then highlight the cells in column A down to the bottom of
your data in B. Then press F5 (GoTo), click on Special and click on
Blanks. Only the blank cells in column A will now be highlighted, with
the active cell being the first empty cell. Then begin a formula by
typing = and then click in the cell above the active cell, then press
CTRL-Enter together. This will put that formula in every blank cell.

You can then highlight column A, click <copy, then Edit | Paste
Special | Values (check) | OK then <Enter in order to fix the values.

Hope this helps.

Pete

On Oct 8, 6:50 pm, Chuck wrote:
I have a spreadsheet that was sent to me that lists Store Numbers, Item
Descriptions and QTY sold. The Spread sheet is 25000 lines long. The problem
i am coming across is the store number cells are merged together. When
unmerge the cells only the first Descrption next to the store number has a
store number associated with it. And everyone below it had a blank cell. So
the data is useless to me in Access because I need to have a store number for
each description. Is there a macro i can create or run that will paste the
first number in the column all the way down and then once is hits a new or
different store number it copies that number and pastes it in all the empty
cells below that, finds the next change in number, copies it and pastes....so
on and so forth. So the end result is there is a corresponding store number
with each product description.




  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default Copy or Fill Down Macro?

That was what I thought you meant and my procedure will give you what
you want - did you try it out?

Pete

On Oct 8, 10:36 pm, Chuck wrote:
Column A is Store Number. And Column B is Descriptions of products sold in
that store. So an example would be A2-A200 is merged and it will say Store
100. And each cell from B2 to B200 will have a different Item description in
it that was sold in store 100. Now if i Unmerge Cell A2-A200 it will put 100
in Cell A2 and leave blanks down to Cell A200. I need to fill then with the
number 100 then When it hits Cell A201 which has a value of 110 in it to copy
that number and paste it from cell A202 down to whenever the store number
changes again.



"Pete_UK" wrote:
Assume your store number is in column A and you have contiguous data
in column B (I think that is what you mean after you unmerge the
cells), then highlight the cells in column A down to the bottom of
your data in B. Then press F5 (GoTo), click on Special and click on
Blanks. Only the blank cells in column A will now be highlighted, with
the active cell being the first empty cell. Then begin a formula by
typing = and then click in the cell above the active cell, then press
CTRL-Enter together. This will put that formula in every blank cell.


You can then highlight column A, click <copy, then Edit | Paste
Special | Values (check) | OK then <Enter in order to fix the values.


Hope this helps.


Pete


On Oct 8, 6:50 pm, Chuck wrote:
I have a spreadsheet that was sent to me that lists Store Numbers, Item
Descriptions and QTY sold. The Spread sheet is 25000 lines long. The problem
i am coming across is the store number cells are merged together. When
unmerge the cells only the first Descrption next to the store number has a
store number associated with it. And everyone below it had a blank cell. So
the data is useless to me in Access because I need to have a store number for
each description. Is there a macro i can create or run that will paste the
first number in the column all the way down and then once is hits a new or
different store number it copies that number and pastes it in all the empty
cells below that, finds the next change in number, copies it and pastes....so
on and so forth. So the end result is there is a corresponding store number
with each product description.- Hide quoted text -


- Show quoted text -



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
Copy Formula from one worksheet to another and fill down Scott Campbell[_2_] Excel Discussion (Misc queries) 2 April 19th 07 02:20 AM
Help - copy a formula using the fill handle Lori Excel Discussion (Misc queries) 5 January 12th 07 03:20 PM
Use data to copy/fill other cells. Harv Excel Discussion (Misc queries) 3 May 11th 06 10:22 PM
The fill feature in Excel that gives option to fill or copy KAHelman New Users to Excel 1 July 29th 05 07:47 PM
Value does not fill down (copy) properly. Karina Excel Discussion (Misc queries) 2 February 1st 05 05:59 PM


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