Solved

Cut certain cells paste to side and shift cells up

Posted on 2011-02-14
5
239 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
  • 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 500 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.

746 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now