Hello everyone,
I am a begginer in VBA and had no real training so I am learning on my own by reading books and exploring forums.
I went through many posts in several forum and Microsoft websites in order to write the code I need but unsuccessfully.
What I am trying to do:
If the cells in column 1 (starting from row 15 and going down until an empty cell) are not empty, put "No" in cells in the column named "Savings" (starting from row 15). I do not want to write the column number because if the number of the column changes, the macro will not run anymore.
What I have written so far :
Option Explicit
Public Sub NoInCells()
Dim CelCount As Integer
CelCount = 15
Range("A15").Select
Do Until IsEmpty(ActiveCell)
'Find the column to write No
Dim column_criteria As Integer
For column_criteria = 1 To 200
If Worksheets("sheet1").Cells(11, column_criteria) = "Savings" Then
????(how to define the cells of the column named Savings)????.FormulaR1C1 = "No"
End If
ActiveCell.Offset(1, 0).Select
Next
CelCount = CelCount + 1
Loop
End Sub
Maybe I have some redundancies here.
Many thanks for your help.
I have other issues with other macros, should I create a post for each of them or write everything in the same?
Ambre
Excel 2010
Windows XP
I am a begginer in VBA and had no real training so I am learning on my own by reading books and exploring forums.
I went through many posts in several forum and Microsoft websites in order to write the code I need but unsuccessfully.
What I am trying to do:
If the cells in column 1 (starting from row 15 and going down until an empty cell) are not empty, put "No" in cells in the column named "Savings" (starting from row 15). I do not want to write the column number because if the number of the column changes, the macro will not run anymore.
What I have written so far :
Option Explicit
Public Sub NoInCells()
Dim CelCount As Integer
CelCount = 15
Range("A15").Select
Do Until IsEmpty(ActiveCell)
'Find the column to write No
Dim column_criteria As Integer
For column_criteria = 1 To 200
If Worksheets("sheet1").Cells(11, column_criteria) = "Savings" Then
????(how to define the cells of the column named Savings)????.FormulaR1C1 = "No"
End If
ActiveCell.Offset(1, 0).Select
Next
CelCount = CelCount + 1
Loop
End Sub
Maybe I have some redundancies here.
Many thanks for your help.
I have other issues with other macros, should I create a post for each of them or write everything in the same?
Ambre
Excel 2010
Windows XP