Solved

Cut certain cells paste to side and shift cells up

Posted on 2011-02-14
5
250 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 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

691 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