Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Counting values in an array where value in one column is not null CW Excel Worksheet Functions 5 April 22nd 10 04:06 AM
Replace Null Values in a Column Steve C Excel Discussion (Misc queries) 4 May 15th 08 08:52 AM
Counting multiple values (including blanks) in one column [email protected] Excel Discussion (Misc queries) 13 March 12th 08 09:21 AM
sum if - null values DC Excel Discussion (Misc queries) 1 October 16th 06 05:56 PM
VB excel Null values !! Please help me !! Aruna Tennakoon Excel Programming 4 April 29th 04 10:13 AM


All times are GMT +1. The time now is 03:17 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"