Caveman1964
Board Regular
- Joined
- Dec 14, 2017
- Messages
- 127
- Office Version
- 2016
- Platform
- Windows
I have totally butchered this.
I had working with a long drawn out "If" "else" and "isempty" code but its too much. I tried to figure out a better way but I cant get to work right.
I want to name g33 k33 o33 s33 w33 and aa33 and have the option button look for right most empty.
Here is my crap. (i named the range Noctwentyfour before I started...then added here because I couldnt get to work...now I've made a mess and need to start over)
Worksheets("Sheet10").Range("g33,k33,o33,s33,w33,aa33").Value = "Noctwentyfour"
Dim ws As Worksheet
Dim lastCol As Long
Dim rightmostEmptyCell As Range
Set noc24 = thisworkbook.Names("noctwentyfour").RefersToRange
lastCol = Noctwentyfour.Cells(1, noc24.Columns.Count).End(xlToLeft).Column
Set rightmostEmptyCell = Noctwentyfour.Cells(1, lastCol + 1)
rightmostEmptyCell.Select
If OptionButton1.Value = True Then ActiveCell.Value = "Vacuum"
Any help would be so appreciated.
I had working with a long drawn out "If" "else" and "isempty" code but its too much. I tried to figure out a better way but I cant get to work right.
I want to name g33 k33 o33 s33 w33 and aa33 and have the option button look for right most empty.
Here is my crap. (i named the range Noctwentyfour before I started...then added here because I couldnt get to work...now I've made a mess and need to start over)
Worksheets("Sheet10").Range("g33,k33,o33,s33,w33,aa33").Value = "Noctwentyfour"
Dim ws As Worksheet
Dim lastCol As Long
Dim rightmostEmptyCell As Range
Set noc24 = thisworkbook.Names("noctwentyfour").RefersToRange
lastCol = Noctwentyfour.Cells(1, noc24.Columns.Count).End(xlToLeft).Column
Set rightmostEmptyCell = Noctwentyfour.Cells(1, lastCol + 1)
rightmostEmptyCell.Select
If OptionButton1.Value = True Then ActiveCell.Value = "Vacuum"
Any help would be so appreciated.