ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Several simple questions (https://www.excelbanter.com/excel-programming/276987-several-simple-questions.html)

Stuart[_5_]

Several simple questions
 
Would be grateful for help with a few simple questions, please:

1. If Not IsEmpty(.Range("F65536").End(xlUp) _
.Offset(-1, -4)) Then
is fine, but "F" is hard-coded. If it were to be the variable
'£Col', how can I change the code so as to get back to
that "B" cell, please?
.Range("B" & ......) ?

Similarly:

2 For Each Cell In .Range("H2", "J" & LastRow) _
.SpecialCells(xlConstants)
is fine, but how to replace "H" with '£Col + 2' and
therefore "J" becoming '£Col + 4' ?

Regards.


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.515 / Virus Database: 313 - Release Date: 01/09/2003



Bob Phillips[_5_]

Several simple questions
 

"Stuart" wrote in message
...
Would be grateful for help with a few simple questions, please:

1. If Not IsEmpty(.Range("F65536").End(xlUp) _
.Offset(-1, -4)) Then
is fine, but "F" is hard-coded. If it were to be the variable
'£Col', how can I change the code so as to get back to
that "B" cell, please?
.Range("B" & ......) ?


If Not IsEmpty(.Cells(Rows.Count, £Col).End(xlUp) _
.Offset(-1, 2 - £Col)) Then

Similarly:

2 For Each Cell In .Range("H2", "J" & LastRow) _
.SpecialCells(xlConstants)
is fine, but how to replace "H" with '£Col + 2' and
therefore "J" becoming '£Col + 4' ?


For Each Cell In .Range(.Cells(2, £Col + 2), .Cells(LastRow, £Col + 4)) _
.SpecialCells(xlConstants)





All times are GMT +1. The time now is 05:11 AM.

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