DebbieEdwards
New Member
- Joined
- May 2, 2013
- Messages
- 10
I have a workbook with Multiple worksheets
The names are:</SPAN>
10</SPAN>
20</SPAN>
Main
</SPAN>
In 10,20 Is a Column (Column C) which contains Codes. For example</SPAN>
RT102422</SPAN>
RT104646</SPAN>
RT105678
</SPAN>
In Main I have a column Called Spent. This is a drop down of the above 10,20</SPAN>
When a user chooses for example 10 I want the macro to start up and:</SPAN>
I have some VBA that will check for a change in a column and if it changes I then go to the macro.</SPAN>
I have some code that cuts and pastes the data but obviously this needs changing quite a lot
</SPAN>
</SPAN>
Apologies in advance. I dont use VBA that much but it anyone can give me any pointers that would be great
Debbie
The names are:</SPAN>
10</SPAN>
20</SPAN>
Main
</SPAN>
In 10,20 Is a Column (Column C) which contains Codes. For example</SPAN>
RT102422</SPAN>
RT104646</SPAN>
RT105678
</SPAN>
In Main I have a column Called Spent. This is a drop down of the above 10,20</SPAN>
When a user chooses for example 10 I want the macro to start up and:</SPAN>
- Find the Active Cell in Main.</SPAN>
- If its 10 I then go to worksheet 10</SPAN>
- Find the last cell with data in it</SPAN>
- Cut the data</SPAN>
- Go back to Main</SPAN>
- Paste the data into the column before the active cell</SPAN>
- If its 20 I then go to worksheet 20</SPAN>
- Find the last cell with data in it</SPAN>
- Cut the data</SPAN>
- Go back to Main</SPAN>
- Paste the data into the column before the active cell</SPAN>
I have some VBA that will check for a change in a column and if it changes I then go to the macro.</SPAN>
I have some code that cuts and pastes the data but obviously this needs changing quite a lot
Code:
'In Main you are in the Active cell
Range("C2").Select
'If the Active Cell is 10 Go to
Sheets("TEN").Select
'Find the Last cell and cut it
Range("C3").Select
Selection.Cut
'Go back to main and find the cell before the active cell and paste in the data
Sheets("Main").Select
Range("B2").Select
ActiveSheet.Paste
</SPAN>
Apologies in advance. I dont use VBA that much but it anyone can give me any pointers that would be great
Debbie