ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   variables in last cell (https://www.excelbanter.com/excel-programming/272054-variables-last-cell.html)

josh

variables in last cell
 
this one is a little bit different this time,

i need to output a variable from vba to the next
available cell in a column in my worksheet, any help
would be much appreciated.

thanks guys
Josh

Bob Phillips[_5_]

variables in last cell
 
Josh,

Cells(Rows.Count, "A").End(xlUp).Offset(1, 0).Value = myVar

puts it in the next available cell in column A

--
HTH

-------

Bob Phillips
... looking out across Poole Harbour to the Purbecks


"josh" wrote in message
...
this one is a little bit different this time,

i need to output a variable from vba to the next
available cell in a column in my worksheet, any help
would be much appreciated.

thanks guys
Josh




Tom Ogilvy

variables in last cell
 
var = 21

set rng = Cells(rows.count,1).End(xlup)(2)

rng.Value = var


Change the 1 in Cells( ,1) to the column where you want the value.

Regards,
Tom Ogilvy


"josh" wrote in message
...
this one is a little bit different this time,

i need to output a variable from vba to the next
available cell in a column in my worksheet, any help
would be much appreciated.

thanks guys
Josh





All times are GMT +1. The time now is 05:43 PM.

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