?
Solved

Cut certain cells paste to side and shift cells up

Posted on 2011-02-14
5
Medium Priority
?
251 Views
Last Modified: 2012-05-11
I have file1 needs to be formatted to file2 every day. Basically, all the rows contain "1.1 - Item(s)..." in column D need to be moved to the right part of the sheet and shift up the empty cells up after that. When I record macro and use "Shift+Ctrl" to select cells, it only records the row number it should go to on this sheet while the number of these rows will changes everyday.
How can I make changes on the VBA code to accomplish this task?
temp1.xls
temp2.xls
0
Comment
Question by:mmcompact
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 2

Expert Comment

by:LelikInside
ID: 34891310
A little hint: Rows(Activecell.row).select
0
 

Author Comment

by:mmcompact
ID: 34891391
could you be more specific? thanks
0
 
LVL 11

Accepted Solution

by:
thydzik earned 2000 total points
ID: 34905716
see the attached. select the temp1.xls and it will populate the 2 columns

 compile-to-2-columns.xls
0
 

Author Comment

by:mmcompact
ID: 34910215
thydzik:

When I check it again, it didn't worked quite as I wanted. First I don't want the script to run when I open it. Secondly, after I put the second column back to the first column and try to run "runme" manually, it didn't cut and paste the rows back
compile-to-2-columns-revised.xls
0
 
LVL 11

Expert Comment

by:thydzik
ID: 34913371
mmcompact,

You did not specify how you wanted the script to run.

Secondly, you did not specify it needed to run in reverse writing from 2 columns to 1.

Please create a new question specifying these new requests.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
This article describes a serious pitfall that can happen when deleting shapes using VBA.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question