PC Review


Reply
Thread Tools Rate Thread

How can i read a specific coloumn values and get its contents?

 
 
vidhya
Guest
Posts: n/a
 
      10th Jul 2009
Hi,

Can anyone plz tell me how to read a specific column values and get its
contents.
I managed to read the specific sheet tat i want and now i need to get the
first column values and also first column count..... and get its contents...

I dont want to use oledb, ie reading from database.. i checked some posts,
but all those are reading database... i dont want it....
 
Reply With Quote
 
 
 
 
AltaEgo
Guest
Posts: n/a
 
      10th Jul 2009

There are a lot of ways. To read cell contents. Here is one:

Sub readValsInCol()

Const myColumn = "A"
'Change to "B" "C", "D", "AB" etc
'depending which column you wish to check
' If you need to read more columns you need
' to change code

strt = ActiveSheet.UsedRange.Row
'gives first row of the used range

fin = ActiveSheet.UsedRange.Rows.Count
'gives number of rows in the used range

For i = strt To fin
'loop through rows of the used range
myval = Range(myColumn & i).Value
Debug.Print myval ' do what you wish here
Next i

End Sub

--
Steve

"vidhya" <(E-Mail Removed)> wrote in message
news:75874154-0D5F-44E8-9B21-(E-Mail Removed)...
> Hi,
>
> Can anyone plz tell me how to read a specific column values and get its
> contents.
> I managed to read the specific sheet tat i want and now i need to get the
> first column values and also first column count..... and get its
> contents...
>
> I dont want to use oledb, ie reading from database.. i checked some posts,
> but all those are reading database... i dont want it....


 
Reply With Quote
 
vidhya
Guest
Posts: n/a
 
      10th Jul 2009

hi thank u so much, i got the no of filled rows....


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
When i try to edit a coloumn in datagrid and calculate the sum of two coloumn in third coloumn alok bansal via .NET 247 Microsoft Dot NET Framework Forms 0 8th Apr 2005 08:48 AM
Re: How do you sum values in a coloumn when it contains #N/A in a ran. Tom Ogilvy Microsoft Excel Programming 0 21st Sep 2004 06:46 PM
How do you sum values in a coloumn when it contains #N/A in a ran. dave Microsoft Excel Programming 0 21st Sep 2004 06:36 PM
RE: How do you sum values in a coloumn when it contains #N/A in a ran. =?Utf-8?B?SmltIFRob21saW5zb24=?= Microsoft Excel Programming 0 21st Sep 2004 06:31 PM
How do you sum values in a coloumn when it contains #N/A in a ran. =?Utf-8?B?c2E=?= Microsoft Excel Programming 0 21st Sep 2004 06:17 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:14 PM.