ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   selectin all the values in a column including null values (https://www.excelbanter.com/excel-programming/345560-selectin-all-values-column-including-null-values.html)

Purnima Sharma

selectin all the values in a column including null values
 
Hi,
I want to write Vb code in a macro which would change all the values in a
column to a certain value. It should include all the null values as well. Is
there any command like end of file in VBA. The code I have written works
fine until it hits a space(null value) and doesn't change the value
afterwards probably because it considers that as en end of file. How can I
include all the values in a column. Can someone help.
Thanks.
Purnima sharma

Tom Ogilvy

selectin all the values in a column including null values
 
You want to fill all 65536 cells in a column

columns(3).Value = 21

--
Regards,
Tom Ogilvy


"Purnima Sharma" <Purnima wrote in message
...
Hi,
I want to write Vb code in a macro which would change all the values in a
column to a certain value. It should include all the null values as well.

Is
there any command like end of file in VBA. The code I have written works
fine until it hits a space(null value) and doesn't change the value
afterwards probably because it considers that as en end of file. How can I
include all the values in a column. Can someone help.
Thanks.
Purnima sharma




Kostela

selectin all the values in a column including null values
 
Hi,

You can try this code.

Sub changevalue()
Dim value, colnum, rowcount
value = 5
colnum = 2
rowcount = Cells(Rows.count, colnum).End(xlUp).Row
For n = 1 To rowcount
Cells(n, colnum) = value
Next n
End Sub


Where value is your chosen value. Colnum is the columnnumber that you
want to change!

Hope it works

Take care

Johan

Purnima Sharma skrev:

Hi,
I want to write Vb code in a macro which would change all the values in a
column to a certain value. It should include all the null values as well. Is
there any command like end of file in VBA. The code I have written works
fine until it hits a space(null value) and doesn't change the value
afterwards probably because it considers that as en end of file. How can I
include all the values in a column. Can someone help.
Thanks.
Purnima sharma




All times are GMT +1. The time now is 12:16 AM.

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