ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Row Number with Text (https://www.excelbanter.com/excel-programming/379724-re-row-number-text.html)

Otto Moehrbach

Row Number with Text
 
Michael
By "updated" I take that to mean the contents of a cell in Column A has
changed (not to blank though). Is that right?
And when that happens you want the row number and the letter D placed in the
15th column. Is that right?
The following macro will do that. Note that this macro must be placed in
the sheet module of your sheet. To access that module, right-click on the
sheet tab, select View Code, and paste this macro into that module. "X" out
of that module to return to your sheet. HTH Otto
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count 1 Then Exit Sub
If IsEmpty(Target.Value) Then Exit Sub
If Target.Column < 1 Then Exit Sub
Cells(Target.Row, 15).Value = Target.Row & "D"
End Sub
"Michael" wrote in message
...
Hi,

I have the following file layed out as:

Column1 Column2..... Column15
Admin 2D
Dispatch 3D
Fleet 4D

What I am trying to do is when column 1 is updated, then on column 15 add
the row for that cell, let's say cell A2, along with a character, in this
case the letter D.

How do I do that using VB?





All times are GMT +1. The time now is 04:51 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com