ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Please help me get around this: (https://www.excelbanter.com/excel-programming/369874-please-help-me-get-around.html)

CarolineHedges[_24_]

Please help me get around this:
 

Selection.End(xlDown).Select
Selection.Offset(2, 0).Select
ActiveCell.FormulaR1C1 = "Total Sales"

Is there a different formula I can use for the 1st line of the above,
to get around the problem it creates when there is only one row of data
in the block?

Thanks

Caroline


--
CarolineHedges
------------------------------------------------------------------------
CarolineHedges's Profile: http://www.excelforum.com/member.php...o&userid=35705
View this thread: http://www.excelforum.com/showthread...hreadid=569941


Tim Marsh

Please help me get around this:
 

don't know if this is the best way, but it works for me (replace your first
line with this): -
'===
Range("A65536").End(xlUp).Select
If ActiveCell.Value "" Then
ActiveCell.Offset(1, 0).Select
End If
'===

hth,

tim

"CarolineHedges"
<CarolineHedges.2ca3n5_1155136891.8779@excelforu m-nospam.com wrote in
message news:CarolineHedges.2ca3n5_1155136891.8779@excelfo rum-nospam.com...

Selection.End(xlDown).Select
Selection.Offset(2, 0).Select
ActiveCell.FormulaR1C1 = "Total Sales"

Is there a different formula I can use for the 1st line of the above,
to get around the problem it creates when there is only one row of data
in the block?

Thanks

Caroline


--
CarolineHedges
------------------------------------------------------------------------
CarolineHedges's Profile:
http://www.excelforum.com/member.php...o&userid=35705
View this thread: http://www.excelforum.com/showthread...hreadid=569941




CarolineHedges[_25_]

Please help me get around this:
 

Thank you

What does this line mean?

If ActiveCell.Value "" Then


--
CarolineHedges
------------------------------------------------------------------------
CarolineHedges's Profile: http://www.excelforum.com/member.php...o&userid=35705
View this thread: http://www.excelforum.com/showthread...hreadid=569941


Tim Marsh

Please help me get around this:
 
it just means if the active cell has an entry, then move to the next row
(i'm guessing this would normally be the case). if the cell is empty, it
stays in that cell (this would only apply where there is nothing in there
are no entries in the column)

hth,

tim

"CarolineHedges"
<CarolineHedges.2ca514_1155138598.4934@excelforu m-nospam.com wrote in
message news:CarolineHedges.2ca514_1155138598.4934@excelfo rum-nospam.com...

Thank you

What does this line mean?

If ActiveCell.Value "" Then


--
CarolineHedges
------------------------------------------------------------------------
CarolineHedges's Profile:
http://www.excelforum.com/member.php...o&userid=35705
View this thread: http://www.excelforum.com/showthread...hreadid=569941





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

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