Automatic Population of one Column

  • Thread starter Thread starter Ahh, Excel's Tough
  • Start date Start date
A

Ahh, Excel's Tough

Hi,
I was wondering if it was possible to automatically populate one
column after one column was filled, say I wanted to put something in
Column A then have a 0 pop up in column C immediately. Is there a
macro/formula to handle this type of operation? Once again, appreciate
the help that has been coming towards my topics and would like to
thank people for any assistance given.
 
Paste this:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 1 And Target.Columns.Count = 1 Then
Application.EnableEvents = False
Target.Offset(, 2).Value = 0
Application.EnableEvents = True
End If
End Sub

in the code module for the worksheet concerned. Can be reached by
right-clicking on the sheet's tab and choosing 'View Code'. Paste where the
cursor is.
The 2 in Target.Offset(, 2).Value = 0 is 2 columns tothe right of the Target
column, which is column 1, represented by the 1 in If Target.Column = 1
 
Paste this:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 1 And Target.Columns.Count = 1 Then
Application.EnableEvents = False
Target.Offset(, 2).Value = 0
Application.EnableEvents = True
End If
End Sub

in the code module for the worksheet concerned. Can be reached by
right-clicking on the sheet's tab and choosing 'View Code'. Paste where the
cursor is.
The 2 in Target.Offset(, 2).Value = 0 is 2 columns tothe right of the Target
column, which is column 1, represented by the 1 in If Target.Column = 1

--
p45cal





- Show quoted text -

Thanks, that works to perfection, however I also have an equation I
want to use involving column B and since the value is being replaced
in column C, the formula automatically clears itself out as soon as I
put something in column A.
 
Just to clarify:You're saying that you have a formula in column C that refers
to column B, and that the formula in Column C is being wiped out by the macro
above?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top