Select a Cell by Mouse Click to select starting point for a Macro

Grimm127

Board Regular
Joined
Aug 17, 2011
Messages
132
Hi All,

I am stuck on something and I am hoping that someone can help me out.
I want to be able to select the cell where this macro will start. IE: Change the Range("C1").select to a user select by clicking a cell? I am not sure how to go about it. What this macro does is it selects a range of columns and rows starting in column C and cuts and pastes it to that last open row in Column A. Its a simple program.

In the columns I have a item number and units. So Lets say I have 8 columns with 10 rows. I cut columns C:H to row 10. Then paste it in A11. Repeat. So I would click C11, Cut (Columns & Rows) paste in A21. Repeat. Unitl I have all 4 segments (Item # & Units) in the same two columns. Any suggestions on how I can manually click the starting point? Thanks so much in advance!!!
Sub Move_Columns()
'
' Move_Columns Macro
'
Range("C1").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Application.CutCopyMode = False
Selection.Cut

'Last Row FORMULA
Dim LastRowBrand As Long

With ActiveSheet
LastRowBrand = .Range("B1").SpecialCells(xlCellTypeLastCell).Row
End With

Range("A" & LastRowBrand).Select

ActiveSheet.Paste

End Sub
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Hello,

if you mean you don't want to start in C1, but somewhere else in the table with the cell that is selected, just remove the

Range("C1").Select

code.
 
Upvote 0
Hello,

if you mean you don't want to start in C1, but somewhere else in the table with the cell that is selected, just remove the

Range("C1").Select

code.

OMG! LMAO! I don't believe it! Removing that line was the most obvious thing to do and I completely missed it!

Thank you so much!!!
 
Upvote 0

Forum statistics

Threads
1,226,729
Messages
6,192,696
Members
453,747
Latest member
tylerhyatt04

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top