Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Referring to a column

This may well be a very daft query! I am writing a macro which
analyses data imported to a spreadsheet. The problem is that it is
carrying out analysis on all cells in a column. However, I want to
follow the progression:

1) Is there a data value in Column A, row X?
2) Use that value to calculate the value for Column P, row X
3) Otherwise, move on to row Y.

I've tried If....Then and Do While.... but I don't know how to
specify point 1). How do I persuade the programme to see whether
Column A, row X is empty or not?

Many thanks,
Helen
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 64
Default Referring to a column

Helen,

something along these lines should work for the first
twenty rows:

Sub CheckCol()

Dim X as integer

For X = 1 to 20

If Cells(1,x).value< "" Then
.. Do Your Thang Here ..
End If

Next X

End Sub

This will loop 20 times, looking at the the value in
Column A, row x each time - Cells(1,x).value - then
carrying out whatever action you require.

Cheers, Pete.

-----Original Message-----
This may well be a very daft query! I am writing a macro

which
analyses data imported to a spreadsheet. The problem is

that it is
carrying out analysis on all cells in a column. However,

I want to
follow the progression:

1) Is there a data value in Column A, row X?
2) Use that value to calculate the value for Column P,

row X
3) Otherwise, move on to row Y.

I've tried If....Then and Do While.... but I don't know

how to
specify point 1). How do I persuade the programme to see

whether
Column A, row X is empty or not?

Many thanks,
Helen
.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Referring to a column

lastRow = Worksheets(“Sheet1”).UsedRange.Row - 1
Worksheets(“Sheet1”).UsedRange.Rows.Count

For x = 1 To lastRow
If Worksheets(“Sheet1”).Cells(x, 1).Value < “” Then
BLAH BLAH BLAH
End If
Next x

Do you get what I'm doing here? - Piku

--
Message posted from http://www.ExcelForum.com

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
Referring to a portion of a column LewisM Excel Discussion (Misc queries) 1 May 28th 10 12:13 AM
Referring a cell Terry0928 via OfficeKB.com Excel Discussion (Misc queries) 3 May 21st 10 09:22 AM
Referring to Cells PeterM Excel Discussion (Misc queries) 4 May 30th 08 02:37 PM
Referring to a list in one sheet to another column on a different jmamakes3 Excel Discussion (Misc queries) 0 July 31st 06 11:42 PM
Referring to a column Hru48 Excel Discussion (Misc queries) 1 January 31st 06 05:59 PM


All times are GMT +1. The time now is 11:02 PM.

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

About Us

"It's about Microsoft Excel"