Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How use =now function and how to retrieve data from another shee?


I've searched through various threads and need two quick questions
answered please :)

1. I need users of the worksheet to be able to hit a button(marco) and
add the contents of say A1 to A2, and have A1 be totally clear after
that. I also need them to only be able to do this after the work day,
say 5. I know this is done with the now function but haven't got it yet


--
dstock
------------------------------------------------------------------------
dstock's Profile: http://www.excelforum.com/member.php...o&userid=24225
View this thread: http://www.excelforum.com/showthread...hreadid=378457

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How use =now function and how to retrieve data from another shee?


First part.

Range("A2") = Range("A1")
Range("A1").ClearContents
or
Worksheets("Sheet1").Range("A2") = Worksheets("Sheet1").Range("A1")
Worksheets("Sheet1").Range("A1").ClearContents


Second part, what do you mean by work day 5.

Mangesh


--
mangesh_yadav
------------------------------------------------------------------------
mangesh_yadav's Profile: http://www.excelforum.com/member.php...o&userid=10470
View this thread: http://www.excelforum.com/showthread...hreadid=378457

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How use =now function and how to retrieve data from another shee?


Thanks for the reply. I work for an energy trading company and am making
a position tracker. At midnight, or 0:00 Eastern Time, I need the
contents of one cell to be summed with the contents of another.
Example

Yesterday Today after the "rollover" or summation fo the two
cells they would
(200) A 100 look like this. So when the clock hits
midnight, it will show this:
100 B 400

Yesterday Today A and B are just different contracts, those rows
are entirely
(100) A 0 independent of one another. I just need to
be able to hit a
500 B 0 or marco or "button" on the spreadsheet
for the traders so when they come in in the morning they can rollover
their positions and have the today column clear to track the trades
they will do for the new day. I hope that makes sense. Thanks for the
hep!


--
dstock
------------------------------------------------------------------------
dstock's Profile: http://www.excelforum.com/member.php...o&userid=24225
View this thread: http://www.excelforum.com/showthread...hreadid=378457

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How use =now function and how to retrieve data from another shee?


I am sorry, I could not understand, but if you want the above macro to
work only after 5 pm, then use:

Private Sub CommandButton1_Click()

If Time TimeValue("17:00:00") And Worksheets("Sheet1").Range("A1") <
"" Then

Worksheets("Sheet1").Range("A2") = Worksheets("Sheet1").Range("A1")
Worksheets("Sheet1").Range("A1").ClearContents

End If

End Sub


Mangesh


--
mangesh_yadav
------------------------------------------------------------------------
mangesh_yadav's Profile: http://www.excelforum.com/member.php...o&userid=10470
View this thread: http://www.excelforum.com/showthread...hreadid=378457

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How use =now function and how to retrieve data from another shee?


thanks for the reply. I posted that code in vb, now how to I assign it
to a macro. I've already got the button on the sheet. When I right
click and select assign macro I select it but it comes up with the
macro cannot be found


--
dstock
------------------------------------------------------------------------
dstock's Profile: http://www.excelforum.com/member.php...o&userid=24225
View this thread: http://www.excelforum.com/showthread...hreadid=378457



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How use =now function and how to retrieve data from another shee?


I attached the file so it will make more sense. Basically what I need is
a macro that by clicking it will sum cell C12 and F12 placing the sum
in F12, C13 and F13 placing the sum in F13, and so on. We just need
yesterdays volume to be combined with todays in each row. Each row
basically represents a different product. The time requirement isn't an
issue. Instead I would like a message to pop up when the macro is hit to
ask "are they sure they want to rollover" Then by click yes or no it
will do so accordingly. Thanks for all the help!


+-------------------------------------------------------------------+
|Filename: example.zip |
|Download: http://www.excelforum.com/attachment.php?postid=3485 |
+-------------------------------------------------------------------+

--
dstock
------------------------------------------------------------------------
dstock's Profile: http://www.excelforum.com/member.php...o&userid=24225
View this thread: http://www.excelforum.com/showthread...hreadid=378457

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How use =now function and how to retrieve data from another shee?


Hi dstock,

post the following code in a standard module. In VBE Insert Module.

Sub myMacro()

If Time TimeValue("17:00:00") And Worksheets("Sheet1").Range("A1") <
"" Then

ans = MsgBox("Do you want to continue", vbYesNo)

If ans = vbNo Then Exit Sub

Worksheets("Sheet1").Range("A2") = Worksheets("Sheet1").Range("A1")
Worksheets("Sheet1").Range("A1").ClearContents

End If

End Sub


Now, put a button and assign the macro. This macro also asks the user
whether to continue with the operation.

Mangesh


--
mangesh_yadav
------------------------------------------------------------------------
mangesh_yadav's Profile: http://www.excelforum.com/member.php...o&userid=10470
View this thread: http://www.excelforum.com/showthread...hreadid=378457

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How use =now function and how to retrieve data from another shee?


hey the previous code you had worked by movingthe contents to sell A2
Based on the example i provided, what should the code be now to do wha
I want still. I tried redoing it with no luck. I appreciate all yo
help, thanks

--
dstoc
-----------------------------------------------------------------------
dstock's Profile: http://www.excelforum.com/member.php...fo&userid=2422
View this thread: http://www.excelforum.com/showthread.php?threadid=37845

  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How use =now function and how to retrieve data from another shee?


Use the followinf macro:

Sub myMacro()

ans = MsgBox("Do you want to continue", vbYesNo)

If ans = vbNo Then Exit Sub

Set myRng = Worksheets("Sheet1").Range("C12:C20")

For Each cl In myRng
Worksheets("Sheet1").Range("F" & cl.Row) =
Worksheets("Sheet1").Range("C" & cl.Row) +
Worksheets("Sheet1").Range("F" & cl.Row)
Worksheets("Sheet1").Range("C" & cl.Row).ClearContents
Next

End Sub


Please substitute the range in the code to suit your case. I have used
C12:C20.

Mangesh


--
mangesh_yadav
------------------------------------------------------------------------
mangesh_yadav's Profile: http://www.excelforum.com/member.php...o&userid=10470
View this thread: http://www.excelforum.com/showthread...hreadid=378457

  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How use =now function and how to retrieve data from another shee?


Thank you sir. I will try to tweak it to exactly what I'm looking fo
but overall its great. Thank you so much. I will probably have mor
questions later but I'm going to work on it all day. :

--
dstoc
-----------------------------------------------------------------------
dstock's Profile: http://www.excelforum.com/member.php...fo&userid=2422
View this thread: http://www.excelforum.com/showthread.php?threadid=37845



  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How use =now function and how to retrieve data from another shee?


Second question for you is a conditional based calculation I believe. A
example is attached. I know its probably easy but again I haven't got i
yet, Thanks

+-------------------------------------------------------------------
|Filename: excelforum example2.zip
|Download: http://www.excelforum.com/attachment.php?postid=3496
+-------------------------------------------------------------------

--
dstoc
-----------------------------------------------------------------------
dstock's Profile: http://www.excelforum.com/member.php...fo&userid=2422
View this thread: http://www.excelforum.com/showthread.php?threadid=37845

  #12   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How use =now function and how to retrieve data from another shee?


Hi Dstock,

many people here do not open attachments for the fear of viruses. So it
would be better if you could explain your query in the post.

Mangesh


--
mangesh_yadav
------------------------------------------------------------------------
mangesh_yadav's Profile: http://www.excelforum.com/member.php...o&userid=10470
View this thread: http://www.excelforum.com/showthread...hreadid=378457

  #13   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How use =now function and how to retrieve data from another shee?


Agreed. Only problem is when I copy and paste the formatting gets messe
up sometimes. I will post add an attachment for those whose don't wan
to open an attachment. I got the conditional worked out. Mangesh thank
for all your help. More questions later today. Its probably bedtime ove
there :

--
dstoc
-----------------------------------------------------------------------
dstock's Profile: http://www.excelforum.com/member.php...fo&userid=2422
View this thread: http://www.excelforum.com/showthread.php?threadid=37845

  #14   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How use =now function and how to retrieve data from another shee?


not yet. just 5:30 pm.

Mangesh


Agreed. Only problem is when I copy and paste the formatting gets messed
up sometimes. I will post add an attachment for those whose don't want
to open an attachment. I got the conditional worked out. Mangesh thanks
for all your help. More questions later today. Its probably bedtime over
there



--
mangesh_yadav
------------------------------------------------------------------------
mangesh_yadav's Profile: http://www.excelforum.com/member.php...o&userid=10470
View this thread: http://www.excelforum.com/showthread...hreadid=378457

  #15   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How use =now function and how to retrieve data from another shee?


My second question, which I don't believe is possible, is it possible to
only hide/unhide and certain second of the block of cells. For example,
if you have a 10X10 are you are working with, can I choose to
hide/unide say the middle3X3. I don't believe this is possible because
it HAS to assign rows and columns for everything. Thanks!
Edit/Delete Message

That rollover function worked. I will be working on it more today and
probably post something tomorrow. Thanks.


--
dstock
------------------------------------------------------------------------
dstock's Profile: http://www.excelforum.com/member.php...o&userid=24225
View this thread: http://www.excelforum.com/showthread...hreadid=378457



  #16   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How use =now function and how to retrieve data from another shee?


So I have grouped cells, but was wondering if it is possible for them t
pop up in stead of down. When I click + they always collapse down, i
there a way to have them collapse up instead

--
dstoc
-----------------------------------------------------------------------
dstock's Profile: http://www.excelforum.com/member.php...fo&userid=2422
View this thread: http://www.excelforum.com/showthread.php?threadid=37845

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
XL07 create data validation list containing the names of each shee ker_01 Excel Worksheet Functions 0 May 14th 09 10:11 PM
look up data from a one w/sheet and take results to another w/shee AndyJ Excel Discussion (Misc queries) 0 January 11th 08 08:14 PM
Auto input data on one sheet based on row selected in another shee Cheese_whiz New Users to Excel 4 November 27th 07 06:17 PM
formula locates common data in a cell and drops them in other shee Barry Walker Excel Discussion (Misc queries) 9 August 14th 07 04:32 PM
How do I group worksheets (Lotus 123 function is "Sheet>Group Shee jaking Excel Worksheet Functions 2 August 30th 05 02:09 PM


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