QuiksilverHg
New Member
- Joined
- Jul 2, 2011
- Messages
- 4
I'm trying to see if a group of cells (on another sheet) is blank as a condition before continuing. I figured out how to check it correctly when I list the cells as a range, but it will not work with the cells command unless I have the sheet selected. Any ideas?
This is what I would like to do:
If Application.CountBlank(Sheets(1).Range(Cells(55, scopy), Cells(59, scopy))) < 5 Then
Where scopy is a variable which will change depending on which column I need to copy from. I am trying to do this entire program without switching back and forth between sheets. Sheet 5 is selected the entire time.
I've tried breaking it down to make sure I had the formatting right for the cells, but these 'test lines' do not work either:
Sheets(1).Cells(55, scopy).Select
Sheets(1).Range(Cells(55, scopy), Cells(59, scopy)).Select
Again it will work if I have sheet 1 selected, but not while sheet 5 is selected. Anyone know what I'm doing wrong or if there's another way to do this?
This is what I would like to do:
If Application.CountBlank(Sheets(1).Range(Cells(55, scopy), Cells(59, scopy))) < 5 Then
Where scopy is a variable which will change depending on which column I need to copy from. I am trying to do this entire program without switching back and forth between sheets. Sheet 5 is selected the entire time.
I've tried breaking it down to make sure I had the formatting right for the cells, but these 'test lines' do not work either:
Sheets(1).Cells(55, scopy).Select
Sheets(1).Range(Cells(55, scopy), Cells(59, scopy)).Select
Again it will work if I have sheet 1 selected, but not while sheet 5 is selected. Anyone know what I'm doing wrong or if there's another way to do this?