Cell Population

  • Thread starter Thread starter Chiccada
  • Start date Start date
C

Chiccada

Hi all,

I am currently tring to create a Macro Which populates any cell in Column
B based on what is entered in the adjacent cell in Column C. For example, if
I enter any one of 601, 609, 623 or 631 in Column C, the cell next to it in
Column B returns the word "Fees". Any other number returns nothing.

Thanks in advance for your help.

Regards
 
Launch VBE using Alt+F11. From the tree view double click 'This Workbook'.
Drop down and get the sheet change event..

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
If Target.Column = 3 Then
Select Case Target.Value
Case 601, 609, 623 Or 631
Cells(Target.Row, 2) = "Fees"
End Select
End If
End Sub

If this post helps click Yes
 
Right click your sheet tab, view code and paste this in

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column <> 3 Or Target.Cells.Count > 1 Or _
IsEmpty(Target) Then Exit Sub
Select Case Target
Case 601, 609, 623, 631
Target.Offset(, -1) = "Fees"
End Select
End Sub


Mike
 
Oops

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
If Target.Column = 3 Then
Select Case Target.Value
Case 601, 609, 623, 631
Cells(Target.Row, 2) = "Fees"
End Select
End If
End Sub
 
Thanks Mike, much appreciated.

Regards,

Rik

Mike H said:
Right click your sheet tab, view code and paste this in

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column <> 3 Or Target.Cells.Count > 1 Or _
IsEmpty(Target) Then Exit Sub
Select Case Target
Case 601, 609, 623, 631
Target.Offset(, -1) = "Fees"
End Select
End Sub


Mike
 

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