Change event VBA / automatic fill

orion2323

New Member
Joined
Dec 20, 2017
Messages
26
Hello again
Hope everyone is having a good day

Wondering if it would be possible to accomplish the following, any help will be greatly appreciated:

I am using the following VBA script which immediately and automatically PRINTS after I enter "f" on C2:C100

Sub jumpnext()
Range("B" & ActiveCell.Row + 1).Select
End Sub


Private Sub Worksheet_Change(ByVal Target As Range)
Dim targCell As Range
Set targCell = Worksheets(1).Range("C2:C100")


If Not Application.Intersect(Target, targCell) Is Nothing Then
If Target.Value = "f" Then
Worksheets(1).PrintOut
End If
End If
End Sub



What I would like to add is the following:

Upon completion on B2 (user input / tab key is pressed), automatically fill cell C2 with "f" to trigger the print job, then automatically fill D2 with any value (let's say another "f") and ultimately, simulate and enter key to return to the cell below, C3

Process is always the same and there could be a small delay after the user input in cell B2

Is this possible ?

Thank you all for your time
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
How can I combine these 2 change of events:

Private Sub Worksheet_Change(ByVal Target As Range)
' Auto Date
Dim Cell As Range
For Each Cell In Target
If Cell.Column = Range("B:B").Column Then
If Cell.Value <> "" Then
Cells(Cell.Row, "C").Value = "f"
Else
Cells(Cell.Row, "C").Value = ""
End If
End If
Next Cell
End Sub

and this:

Sub jumpnext()
Range("B" & ActiveCell.Row + 1).Select
End Sub


Private Sub Worksheet_Change(ByVal Target As Range)
Dim targCell As Range
Set targCell = Worksheets(1).Range("C2:C100")


If Not Application.Intersect(Target, targCell) Is Nothing Then
If Target.Value = "f" Then
Worksheets(1).PrintOut
End If
End If
End Sub
 
Upvote 0
Nevermind, got those 2 working...
New question :)

Can I add another automatic cell input to this, so that if "C:C" has a value, then "D" = "f"


Private Sub Worksheet_Change(ByVal Target As Range)
' Auto Date
Dim Cell As Range
For Each Cell In Target
If Cell.Column = Range("B:B").Column Then
If Cell.Value <> "" Then
Cells(Cell.Row, "C").Value = "f"
Else
Cells(Cell.Row, "C").Value = ""
End If
End If
Next Cell
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,828
Messages
6,181,214
Members
453,024
Latest member
Wingit77

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