Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default How do I ? Macro - cont'd from 5/9 posting

I think I need to start over from the beginning as I am new to this. Joining
up to different parts of code isn't going well here, so I will explain
eveerything that is supposed to happen here.

My spreadsheet starts out with 5 columns of info:

A B C DD E
A B C D
A B C D
A B C D E
A B C D E
A B C D E
A B C D
A B C D E

What I want to do is insert a new column before 'A' to make a new 'A' and
the stuff in the original 'A' column will move to 'B'. Then I want to take
new cell 'D1'and copy/paste the value from that cell in all cells that are in
column 'A' that have values next to them in column'B'.

A B C DD E F
DD A B C D E
DD A B C D
DD A B C D
DD A B C D E
DD A B C D E

The next step would delete row 1, as that information is no longer needed.

DD A B C D E
DD A B C D
DD A B C D
DD A B C D E
DD A B C D E
DD A B C D E

I would then like to take the values in column 'F' and move them under the
last filled cell in column 'C'. There should be no spaces in column 'C', and
there should also be nothing left in column 'F'.

A B C DD E
DD A B C D
DD A B C D
DD A B C D
DD A B C D
DD A B C D
DD A B C D
E
E
E
E


This macro cannot reference any specific cells other then 'D1' as the size
of the worksheet can change.

Thanks,
--
Malissa

--
Malissa
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,533
Default How do I ? Macro - cont'd from 5/9 posting

Hi Malissa

Maybe this is what you need:

Sub Manupulate()
Columns(1).Insert
LastRow = Range("B1").End(xlDown).Row
Range("D1").Copy Range("A1", Cells(LastRow, 1))
Rows(1).Delete
Range("F1", Cells(LastRow - 1, "F")).Cut Cells(LastRow, 3)
LastR = Cells(Rows.Count, 3).End(xlUp).Row
FirstR = Cells(1, 3).End(xlDown).Row
For r = LastR To FirstR Step -1
If Cells(r, 3).Value = "" Then Rows(r).Delete
Next
End Sub

Regards,
Per

"Malissa" skrev i meddelelsen
...
I think I need to start over from the beginning as I am new to this.
Joining
up to different parts of code isn't going well here, so I will explain
eveerything that is supposed to happen here.

My spreadsheet starts out with 5 columns of info:

A B C DD E
A B C D
A B C D
A B C D E
A B C D E
A B C D E
A B C D
A B C D E

What I want to do is insert a new column before 'A' to make a new 'A' and
the stuff in the original 'A' column will move to 'B'. Then I want to
take
new cell 'D1'and copy/paste the value from that cell in all cells that are
in
column 'A' that have values next to them in column'B'.

A B C DD E F
DD A B C D E
DD A B C D
DD A B C D
DD A B C D E
DD A B C D E

The next step would delete row 1, as that information is no longer needed.

DD A B C D E
DD A B C D
DD A B C D
DD A B C D E
DD A B C D E
DD A B C D E

I would then like to take the values in column 'F' and move them under the
last filled cell in column 'C'. There should be no spaces in column 'C',
and
there should also be nothing left in column 'F'.

A B C DD E
DD A B C D
DD A B C D
DD A B C D
DD A B C D
DD A B C D
DD A B C D
E
E
E
E


This macro cannot reference any specific cells other then 'D1' as the size
of the worksheet can change.

Thanks,
--
Malissa

--
Malissa


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default How do I ? Macro - cont'd from 5/9 posting

Thats exactly what I needed! Thank you!
--
Malissa


"Per Jessen" wrote:

Hi Malissa

Maybe this is what you need:

Sub Manupulate()
Columns(1).Insert
LastRow = Range("B1").End(xlDown).Row
Range("D1").Copy Range("A1", Cells(LastRow, 1))
Rows(1).Delete
Range("F1", Cells(LastRow - 1, "F")).Cut Cells(LastRow, 3)
LastR = Cells(Rows.Count, 3).End(xlUp).Row
FirstR = Cells(1, 3).End(xlDown).Row
For r = LastR To FirstR Step -1
If Cells(r, 3).Value = "" Then Rows(r).Delete
Next
End Sub

Regards,
Per

"Malissa" skrev i meddelelsen
...
I think I need to start over from the beginning as I am new to this.
Joining
up to different parts of code isn't going well here, so I will explain
eveerything that is supposed to happen here.

My spreadsheet starts out with 5 columns of info:

A B C DD E
A B C D
A B C D
A B C D E
A B C D E
A B C D E
A B C D
A B C D E

What I want to do is insert a new column before 'A' to make a new 'A' and
the stuff in the original 'A' column will move to 'B'. Then I want to
take
new cell 'D1'and copy/paste the value from that cell in all cells that are
in
column 'A' that have values next to them in column'B'.

A B C DD E F
DD A B C D E
DD A B C D
DD A B C D
DD A B C D E
DD A B C D E

The next step would delete row 1, as that information is no longer needed.

DD A B C D E
DD A B C D
DD A B C D
DD A B C D E
DD A B C D E
DD A B C D E

I would then like to take the values in column 'F' and move them under the
last filled cell in column 'C'. There should be no spaces in column 'C',
and
there should also be nothing left in column 'F'.

A B C DD E
DD A B C D
DD A B C D
DD A B C D
DD A B C D
DD A B C D
DD A B C D
E
E
E
E


This macro cannot reference any specific cells other then 'D1' as the size
of the worksheet can change.

Thanks,
--
Malissa

--
Malissa



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
Removing weekend/holiday dates - cont'd GR Charts and Charting in Excel 4 January 10th 08 09:09 PM
Excel 2007 Macro/Link Issue (apologies for cross-posting) MorgSz Links and Linking in Excel 2 July 25th 07 08:12 PM
Help cont'd A.S. Excel Discussion (Misc queries) 1 August 4th 06 07:36 PM
Cont'd - Offsetting within a range dynamically - But returning a sum of all instances criteria are met S Davis Excel Worksheet Functions 1 July 28th 06 03:37 PM
the owner of posting should be able to delete the posting Mahendra Excel Discussion (Misc queries) 7 August 8th 05 07:21 PM


All times are GMT +1. The time now is 04:43 PM.

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"