Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default macro only run if cell is not empty

i have a macro thats copy a row to a worksheet. To make it perfect i want
that the macro looks if for example Cell A 5 in that row is not empty. If its
not empty run de macro thats copy the row to a worksheet. If its not empty
that the user got an error windows for example: A5 is empty Macro do not work.

is this possible...?

greetings.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 110
Default macro only run if cell is not empty



try this

Public Sub test()
If Range("A5") < "" Then
(macro name)
Else
MsgBox "A5 is empty Macro does not work."


End If
End Sub

"Pieter" wrote in message
...
i have a macro thats copy a row to a worksheet. To make it perfect i want
that the macro looks if for example Cell A 5 in that row is not empty. If

its
not empty run de macro thats copy the row to a worksheet. If its not empty
that the user got an error windows for example: A5 is empty Macro do not

work.

is this possible...?

greetings.




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default macro only run if cell is not empty

If Range("A5") = Empty Then
MsgBox "Cell A5 is empty!"
Else
Call copymacro_name
End If


Regards,
Stefi

€˛Pieter€¯ ezt Ć*rta:

i have a macro thats copy a row to a worksheet. To make it perfect i want
that the macro looks if for example Cell A 5 in that row is not empty. If its
not empty run de macro thats copy the row to a worksheet. If its not empty
that the user got an error windows for example: A5 is empty Macro do not work.

is this possible...?

greetings.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default macro only run if cell is not empty

thanks for the quick response but
this is only working when cell A5 is empty.
it must also work when i want to run de macro on row 150 for example.
so then A 150 the macro had to check if its empty or not.

gr.

"Stefi" wrote:

If Range("A5") = Empty Then
MsgBox "Cell A5 is empty!"
Else
Call copymacro_name
End If


Regards,
Stefi

€˛Pieter€¯ ezt Ć*rta:

i have a macro thats copy a row to a worksheet. To make it perfect i want
that the macro looks if for example Cell A 5 in that row is not empty. If its
not empty run de macro thats copy the row to a worksheet. If its not empty
that the user got an error windows for example: A5 is empty Macro do not work.

is this possible...?

greetings.


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default macro only run if cell is not empty

If Range("A" & ActiveCell.Row) = Empty Then
MsgBox "Cell A5 is empty!"
Else
Call copymacro_name
End If

Regards,
Stefi

€˛Pieter€¯ ezt Ć*rta:

thanks for the quick response but
this is only working when cell A5 is empty.
it must also work when i want to run de macro on row 150 for example.
so then A 150 the macro had to check if its empty or not.

gr.

"Stefi" wrote:

If Range("A5") = Empty Then
MsgBox "Cell A5 is empty!"
Else
Call copymacro_name
End If


Regards,
Stefi

€˛Pieter€¯ ezt Ć*rta:

i have a macro thats copy a row to a worksheet. To make it perfect i want
that the macro looks if for example Cell A 5 in that row is not empty. If its
not empty run de macro thats copy the row to a worksheet. If its not empty
that the user got an error windows for example: A5 is empty Macro do not work.

is this possible...?

greetings.




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default macro only run if cell is not empty

Perfect this is exactly what i want...

thanks

"Stefi" wrote:

If Range("A" & ActiveCell.Row) = Empty Then
MsgBox "Cell A5 is empty!"
Else
Call copymacro_name
End If

Regards,
Stefi

€˛Pieter€¯ ezt Ć*rta:

thanks for the quick response but
this is only working when cell A5 is empty.
it must also work when i want to run de macro on row 150 for example.
so then A 150 the macro had to check if its empty or not.

gr.

"Stefi" wrote:

If Range("A5") = Empty Then
MsgBox "Cell A5 is empty!"
Else
Call copymacro_name
End If


Regards,
Stefi

€˛Pieter€¯ ezt Ć*rta:

i have a macro thats copy a row to a worksheet. To make it perfect i want
that the macro looks if for example Cell A 5 in that row is not empty. If its
not empty run de macro thats copy the row to a worksheet. If its not empty
that the user got an error windows for example: A5 is empty Macro do not work.

is this possible...?

greetings.


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default macro only run if cell is not empty

You are welcome! Thanks for the feedback!
Regards,
Stefi


€˛Pieter€¯ ezt Ć*rta:

Perfect this is exactly what i want...

thanks

"Stefi" wrote:

If Range("A" & ActiveCell.Row) = Empty Then
MsgBox "Cell A5 is empty!"
Else
Call copymacro_name
End If

Regards,
Stefi

€˛Pieter€¯ ezt Ć*rta:

thanks for the quick response but
this is only working when cell A5 is empty.
it must also work when i want to run de macro on row 150 for example.
so then A 150 the macro had to check if its empty or not.

gr.

"Stefi" wrote:

If Range("A5") = Empty Then
MsgBox "Cell A5 is empty!"
Else
Call copymacro_name
End If


Regards,
Stefi

€˛Pieter€¯ ezt Ć*rta:

i have a macro thats copy a row to a worksheet. To make it perfect i want
that the macro looks if for example Cell A 5 in that row is not empty. If its
not empty run de macro thats copy the row to a worksheet. If its not empty
that the user got an error windows for example: A5 is empty Macro do not work.

is this possible...?

greetings.


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
Getting a macro to see the next available empty cell Mark 688 Excel Discussion (Misc queries) 1 September 9th 05 04:19 PM
Macro to populate next empty cell? Ouka Excel Programming 3 June 3rd 05 04:17 PM
Macro to run if cell empty Greg[_20_] Excel Programming 15 April 15th 05 08:01 PM
macro to look for empty cell esrei Excel Discussion (Misc queries) 1 April 14th 05 11:57 AM
Need help with empty cell in Macro Don Excel Programming 4 September 30th 04 02:50 AM


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