Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default OR statement on macro

I have a macro that states
Do While .Cells(RowCount, "D").Value < ""
But i run into a problem because sometimes the database can have 100 values
on Column D but sometimes it fills up the entire spreadsheet up to the end
which is row 65536

When this happends the macro stops running because there is no cell on
Column D that is empty.
so i was wondering how i could make that work i thought an Or statement
would work so i used
RowCount=8
EndCell= 65536
Do While .Cells(RowCount, "D").Value < "" or Do Until .Cells(EndCell,
"D").Value<""

But that doesnt work

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,420
Default OR statement on macro

Do While .Cells(RowCount, "D").Value < "" Or RowCount = .Rows.Count


--
__________________________________
HTH

Bob

"computers hate me" wrote in
message ...
I have a macro that states
Do While .Cells(RowCount, "D").Value < ""
But i run into a problem because sometimes the database can have 100
values
on Column D but sometimes it fills up the entire spreadsheet up to the end
which is row 65536

When this happends the macro stops running because there is no cell on
Column D that is empty.
so i was wondering how i could make that work i thought an Or statement
would work so i used
RowCount=8
EndCell= 65536
Do While .Cells(RowCount, "D").Value < "" or Do Until .Cells(EndCell,
"D").Value<""

But that doesnt work



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default OR statement on macro

that still gave me an error sign i then tried

rowcount=8
endcell=65536

Do While .Cells(RowCount, "D").Value < "" Or .Cells(Endcell, "D") = ""

it also returned an error message

i know its the fact that it goes to the last cell because when i delete the
content in cell 65536 my first macro (without the or) works just fine

"Bob Phillips" wrote:

Do While .Cells(RowCount, "D").Value < "" Or RowCount = .Rows.Count


--
__________________________________
HTH

Bob

"computers hate me" wrote in
message ...
I have a macro that states
Do While .Cells(RowCount, "D").Value < ""
But i run into a problem because sometimes the database can have 100
values
on Column D but sometimes it fills up the entire spreadsheet up to the end
which is row 65536

When this happends the macro stops running because there is no cell on
Column D that is empty.
so i was wondering how i could make that work i thought an Or statement
would work so i used
RowCount=8
EndCell= 65536
Do While .Cells(RowCount, "D").Value < "" or Do Until .Cells(EndCell,
"D").Value<""

But that doesnt work




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
IF Statement in a macro: Damil4real Excel Discussion (Misc queries) 2 August 12th 09 06:28 PM
IF statement in macro Aline Excel Worksheet Functions 4 September 30th 08 07:40 PM
Macro statement when opening file, but no macro Robert Smith[_3_] Excel Programming 3 May 20th 07 05:58 PM
Run Macro From If Statement bhalooneel Excel Programming 3 June 3rd 05 10:07 PM
Run Macro From If Statement tkaplan[_2_] Excel Programming 0 June 3rd 05 06:31 PM


All times are GMT +1. The time now is 10:29 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"