Need Help With Macro

JHollowell8

Board Regular
Joined
Nov 27, 2006
Messages
120
Hello All,

Can someone please help me write a macro that would do the following. I'm a beginner with vba. I have a series of independent columns of data that are task lists for separate jobs. I want to have a macro where i can click a cell associated with a task that i have completed and the macro would format the text to be grayed out with a strike through in the text and would then move it to the bottom of the list in that columns without leaving behind an empty cell. Basically it would take that task out of line and change it's format and send it to the end of the line (bottom of that column) and then shift the tasks up in line. Each column represents a different job and set of tasks. I would like to click the task, then click a button on the worksheet or toolbar that would accomplish all of that in one swift kick. Can someone please help me do this?

Thanks a bunch!
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
The first 2 are easy
Code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Target.Column <> 5 Then Exit Sub
Target.Font.ColorIndex = 15
Target.Font.Strikethrough = True
End Sub

Moving it and moving the column up is more difficult. I need to think about that

lenze
 
Upvote 0
That works great, but how can I change that to be a control button on the worksheet where I can just click the cell and then click the button? The double click seems too easy to accidentally trigger if other tasks were being added to the list. Thanks for the reply!
 
Upvote 0
Code:
Sub Button1_Click()
Selection.Font.ColorIndex = 15
Selection.Font.Strikethrough = True
End Sub

lenze
 
Upvote 0
Sub Button1_Click()
Selection.Font.ColorIndex = 15
Selection.Font.Strikethrough = True
Selection.Copy

NextRow = Application.WorksheetFunction.CountA(Range("A:A")) + 1
Cells(NextRow, 1).Select
Selection.PasteSpecial

End Sub

This is what I have so far. It gets me the formatting plus the copy of the cell at the end like I want. How can I replace the "1" in the Cells() to just pick whatever column I'm in since it is not necessarily column 1. Also, does anyone know what I can add to delete the copied cell after it is copied and then shift the cells below upward?
 
Upvote 0

Forum statistics

Threads
1,214,945
Messages
6,122,395
Members
449,081
Latest member
JAMES KECULAH

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