Hi, I am new to excel VBA. I am trying to create a VBA macro that will mark an X in Column B for all of the current rows. I am looking for it to count all of the current rows starting with "A5". I've attached a copy of the code that I have and a snip of the spreadsheet that I'm working.
Snip of Spreadsheet:
Current Code that I have:
Sub Check_All()
Sheets("Material Summary").Activate
Dim MyRange As Range
Dim i As Integer, j As Integer
Set MyRange = Selection
Range("B5").Select
For j = 1 To MyRange.Rows.Count
MyRange.Cells(j, 2) = "X"
Next j
End Sub
I am very new to VBA so any help is appreciated!
Snip of Spreadsheet:
Sort | CLIN | Part Number | |
1 | 0001 | 80510 | |
2 | 0001 | 23253 | |
3 | 0002 | 25436 |
Current Code that I have:
Sub Check_All()
Sheets("Material Summary").Activate
Dim MyRange As Range
Dim i As Integer, j As Integer
Set MyRange = Selection
Range("B5").Select
For j = 1 To MyRange.Rows.Count
MyRange.Cells(j, 2) = "X"
Next j
End Sub
I am very new to VBA so any help is appreciated!