Looking for macro

jackel7777

New Member
Joined
Jul 20, 2007
Messages
6
I have never created a macro and would appreciate any help. I have created a worksheet for depositing checks with my company and would like to have a checkbox column at the end of each row. The row contains an account number, name, check number, type, in 4 different cells. Is there a way I can create a macro that allows me to check the box at the end of the each row only if I want a receipt generated. I only want the receipt worksheet page populated with the 4 cells if and only if the checkbox is checked at the end of that row.
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
jackel7777;

I'd enter a Header for Column 5 calling it Select?
Format the all cells in the Column as Font Marlett
Enter the single character "a" (that's lowercase a)
as you do a check box character will show up.

Engage the Auto-Filter on all five columns and filter
on Column 5 Select? choosing a < only your selected
accounts will then show
 
Upvote 0
I am a little confused being such a novice, but I did try your suggestion. Once I have the auto filter on column 5, how do I have the program move the information from the "Check" worksheet to automatically populate the "Receipt" worksheet? What sort of formula do I have to put in to have the information on a checked row's 4 cells to only populate my receipt page one row at a time? I am only trying to populate the receipt page one with one row at a time if that makes any sense. Any help would be much appreciated. THX
 
Upvote 0
Alright I found an old post using VB. It creates a check box but now how do I condition it to move the 4 cells "C1,C2,C3,C4" to 4 specific cells on another worksheet? Here is the code I found

I'm not sure if this will help, but I use this code (I did not make it). It creates a checkbox automatically for you. Very nice, not a standard checkbox design, plus it highlights the background in yellow, so it's very visible when you're using a lot of checkboxes. It will put a true or false in the cell that the checkbox rests above. So you can then use a range formula to add the true/false statements.

Not sure if this helps you or not.

To use:
Go to Tools>Macro>Macros>type a name (chckbxmkr) then click Create.
Paste this code, exit VB.

Select as many cells on your worksheet as you want, run this, and sweet little checkboxes will appear above every cell you have selected.

"Andrew's Excel Tips" is where I got this from.
I take no credit.

Good luck,
Teacher Eric

---------------
Sub chckbxmkr()

On Error Resume Next
Dim c As Range, myRange As Range
Set myRange = Selection
For Each c In myRange.Cells
ActiveSheet.CheckBoxes.Add(c.Left, c.Top, c.Width, c.Height).Select
With Selection
.LinkedCell = c.Address
.Characters.Text = ""
.Name = c.Address
End With
c.Select
With Selection
.FormatConditions.Delete
.FormatConditions.Add Type:=xlExpression, _
Formula1:="=" & c.Address & "=TRUE"
.FormatConditions(1).Font.ColorIndex = 6 'change for other color when ticked
.FormatConditions(1).Interior.ColorIndex = 6 'change for other color when ticked
.Font.ColorIndex = 2 'cell background color = White
End With
Next
myRange.Select
End Sub


Please Help!
Thanks!
Briana
 
Upvote 0
Welcome to the Board!

now how do I condition it to move the 4 cells "C1,C2,C3,C4" to 4 specific cells on another worksheet?

Just change the range reference:

Code:
Set myRange = Sheets("Sheet2").Range("C1:C4")

The way that code is written, you'll also need to activate that sheet.

Hope that helps,

Smitty

NOTE: I locked the duplicate posts that John referred to above. It helps to stay in the same post and not create duplicates. ;)
 
Upvote 0

Forum statistics

Threads
1,224,802
Messages
6,181,048
Members
453,014
Latest member
Chris258

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