Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Macro of exact cell value

Hi,

"I'm working on a sheet were sheet 1 has the summary of all the sheets
from sheet 2 to sheet 32 day(where sheet 2 to sheet 32 are given name as day
1,2,3, and so on to 31st)and which has the actual data

I have to work on number of batches, in which 1 batch have an
max count of 50. So I have given a countif function in cell D2. saying that
whenever there is "completed" in cell G10:G110 show me the count of
"Completed" in Cell "D2", as once I reach to the count of 50 I need to close
that particular batch. and so on I have given Countif function in other cells
as well, which refer to other ranges for example in the case of Cell "E2"
Countif function will refer to range G150:G250.
So I have given Countif function in Cell as below: -
D2,E2,F2,G2,H2,I2
and J2 on each sheet. Were cell D2 is for the first batch, cell E2 is for
second batch, cell F2 for third batch and so on.
What I want is whenever cell D2,E2,F2,G2,H2,I2 and J2 shows up a count of
50, it should show up a message box saying "" Do you want to Close the
Batch?"".
Whereas Cell D2 will show up count 50 for the first batch and thereafter the
second batch, so there is the time difference in each batch. So whenever the
above cells show an count of 50 it should pop up with the above message.
I want a macro for this. but the macro should not include sheet 1 because it
has the summary of the rest of the sheets.


--
vijay
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Macro of exact cell value

Hi,

I'm not at all clear on what you want but we can start here. Alt+F11 to open
VB editor. Double click 'ThisWorkbook' and paste the code below in. Now if d2
in any sheet except the first reaches 50 you will get a popup message

Private Sub Workbook_SheetCalculate(ByVal Sh As Object)
For x = 2 To Worksheets.Count
If Sheets(x).Range("D2").Value = 50 Then
MsgBox Sheets(x).Name & " " & "has reached 50"
End If
Next
End Sub

Mike

"vijay" wrote:

Hi,

"I'm working on a sheet were sheet 1 has the summary of all the sheets
from sheet 2 to sheet 32 day(where sheet 2 to sheet 32 are given name as day
1,2,3, and so on to 31st)and which has the actual data

I have to work on number of batches, in which 1 batch have an
max count of 50. So I have given a countif function in cell D2. saying that
whenever there is "completed" in cell G10:G110 show me the count of
"Completed" in Cell "D2", as once I reach to the count of 50 I need to close
that particular batch. and so on I have given Countif function in other cells
as well, which refer to other ranges for example in the case of Cell "E2"
Countif function will refer to range G150:G250.
So I have given Countif function in Cell as below: -
D2,E2,F2,G2,H2,I2
and J2 on each sheet. Were cell D2 is for the first batch, cell E2 is for
second batch, cell F2 for third batch and so on.
What I want is whenever cell D2,E2,F2,G2,H2,I2 and J2 shows up a count of
50, it should show up a message box saying "" Do you want to Close the
Batch?"".
Whereas Cell D2 will show up count 50 for the first batch and thereafter the
second batch, so there is the time difference in each batch. So whenever the
above cells show an count of 50 it should pop up with the above message.
I want a macro for this. but the macro should not include sheet 1 because it
has the summary of the rest of the sheets.


--
vijay

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Macro of exact cell value

Hi Mike,

What I want is a message box should pop up saying "Do you want to Close the
Batch" whenever there is a count showing as only 50 in the Cells
D2,E2,F2,G2,H2 and J2 on all the sheets that I have in the workbook, except
the sheet1 which has the summary report.
--
vijay


"Mike H" wrote:

Hi,

I'm not at all clear on what you want but we can start here. Alt+F11 to open
VB editor. Double click 'ThisWorkbook' and paste the code below in. Now if d2
in any sheet except the first reaches 50 you will get a popup message

Private Sub Workbook_SheetCalculate(ByVal Sh As Object)
For x = 2 To Worksheets.Count
If Sheets(x).Range("D2").Value = 50 Then
MsgBox Sheets(x).Name & " " & "has reached 50"
End If
Next
End Sub

Mike

"vijay" wrote:

Hi,

"I'm working on a sheet were sheet 1 has the summary of all the sheets
from sheet 2 to sheet 32 day(where sheet 2 to sheet 32 are given name as day
1,2,3, and so on to 31st)and which has the actual data

I have to work on number of batches, in which 1 batch have an
max count of 50. So I have given a countif function in cell D2. saying that
whenever there is "completed" in cell G10:G110 show me the count of
"Completed" in Cell "D2", as once I reach to the count of 50 I need to close
that particular batch. and so on I have given Countif function in other cells
as well, which refer to other ranges for example in the case of Cell "E2"
Countif function will refer to range G150:G250.
So I have given Countif function in Cell as below: -
D2,E2,F2,G2,H2,I2
and J2 on each sheet. Were cell D2 is for the first batch, cell E2 is for
second batch, cell F2 for third batch and so on.
What I want is whenever cell D2,E2,F2,G2,H2,I2 and J2 shows up a count of
50, it should show up a message box saying "" Do you want to Close the
Batch?"".
Whereas Cell D2 will show up count 50 for the first batch and thereafter the
second batch, so there is the time difference in each batch. So whenever the
above cells show an count of 50 it should pop up with the above message.
I want a macro for this. but the macro should not include sheet 1 because it
has the summary of the rest of the sheets.


--
vijay

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
Macro for cell showing exact value vijay[_3_] Excel Programming 2 October 12th 09 09:22 PM
How to strore exact double from macro into Excel cell? JoeU2004 Excel Programming 24 October 8th 09 12:57 PM
Copying exact formula from one worksheet to another within a macro Eric_G Excel Programming 3 March 5th 09 06:20 PM
Routine to find exact Row matches in Col1 Col2 Col3 but exact offsetting numbers in Col4 [email protected] Excel Discussion (Misc queries) 0 June 11th 08 11:30 PM
Macro to Lookup Exact Value K[_2_] Excel Programming 3 December 16th 07 09:07 PM


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