View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Kostela Kostela is offline
external usenet poster
 
Posts: 1
Default 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