Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
n0 h4ck1ng
 
Posts: n/a
Default help with formulas and dates???




on sheet1 i have a list of items in col a and in col b i enter the qty
of those items on a daily basis ex.

........a..............................b.......... ...............
beef................................3............. ......
cod..................................1
chicken............................24

col b is different every day

on sheet 2 i have a list of days in col a col b would be beef col c
would be cod and col d would be chicken ex....

..........a..........................b............ .............c...................d................ ..
...................................beef........... .........cod.................chicken
8/14/05
8/15/05
8/16/05

if today is the 14th i need col b to enter the number for beef on sheet
1 same for cod ect... than tommarow when i change those #'s on sheet1 i
need the 14th's # to stay and the new # to go to the 15th keeping a
daily log of those #'s

is this posible please help???

thank you


--
n0 h4ck1ng
------------------------------------------------------------------------
n0 h4ck1ng's Profile: http://www.excelforum.com/member.php...o&userid=18410
View this thread: http://www.excelforum.com/showthread...hreadid=395696

  #2   Report Post  
Biff
 
Posts: n/a
Default

Hi!

Here's half a solution.....

The "problem" with what you want is that if you use formulas the formulas
don't or can't automatically convert to constants unless you use some VBA
code.

The formula part is easy.....

In Sheet2 B2 enter this formula:

=IF($A2=TODAY(),VLOOKUP(B$1,Sheet1!$A$1:$B$10,2,0) ,"")

Copy across then down as needed.

Now comes the tricky part!

At the end of the day (before midnight when the date changes) you will have
to convert the formulas in the row that corresponds with that days date to
constants. My VBA skills are truly lacking but I know enough (I think) to
come up with a very simple macro to do that.

Sub MakeValues()
Selection.Value = Selection.Value
End Sub

You could put a button on Sheet2 and assign the macro to that button. At the
end of that day, say the date is 8/14/2005, you would select all the cells
starting in B2 and to the right then click the button to convert the
formulas to constants.

Maybe someone will chime in with a more robust way to convert the formulas
to constants.

Biff

"n0 h4ck1ng" wrote
in message ...



on sheet1 i have a list of items in col a and in col b i enter the qty
of those items on a daily basis ex.

.......a..............................b........... ..............
beef................................3............. ......
cod..................................1
chicken............................24

col b is different every day

on sheet 2 i have a list of days in col a col b would be beef col c
would be cod and col d would be chicken ex....

.........a..........................b............. ............c...................d................. .
..................................beef............ ........cod.................chicken
8/14/05
8/15/05
8/16/05

if today is the 14th i need col b to enter the number for beef on sheet
1 same for cod ect... than tommarow when i change those #'s on sheet1 i
need the 14th's # to stay and the new # to go to the 15th keeping a
daily log of those #'s

is this posible please help???

thank you


--
n0 h4ck1ng
------------------------------------------------------------------------
n0 h4ck1ng's Profile:
http://www.excelforum.com/member.php...o&userid=18410
View this thread: http://www.excelforum.com/showthread...hreadid=395696



  #3   Report Post  
Bryan Hessey
 
Posts: n/a
Default


The easy way is with a button which acts on selected data fields and a
cell containing =Day(Now()) (on the example, cell C10 in Sheet1)

Select a cell to hold the Day number, and in the cell to the left of it
right-aline the words 'Update Day '
In the cell to the right of it create a button, and the code for the
button needs to include lines such as:

Dim dy As Integer
dy = Range("sheet1!c10").Value
Range("sheet2!a" & dy).Value = Range("sheet1!b3").Value
Range("sheet2!b" & dy).Value = Range("sheet1!b4").Value
Range("sheet2!c" & dy).Value = Range("sheet1!b5").Value

which, for day 16, makes Sheet2 cell a15 a copy of Sheet1 cell B3 etc.
You will need to click this button at the end of each day, or, better
still, each time you enter figures so as not to miss any.

If you need help to create a button just reply so.



Biff Wrote:
Hi!

Here's half a solution.....

The "problem" with what you want is that if you use formulas the
formulas
don't or can't automatically convert to constants unless you use some
VBA
code.

The formula part is easy.....

In Sheet2 B2 enter this formula:

=IF($A2=TODAY(),VLOOKUP(B$1,Sheet1!$A$1:$B$10,2,0) ,"")

Copy across then down as needed.

Now comes the tricky part!

At the end of the day (before midnight when the date changes) you will
have
to convert the formulas in the row that corresponds with that days date
to
constants. My VBA skills are truly lacking but I know enough (I think)
to
come up with a very simple macro to do that.

Sub MakeValues()
Selection.Value = Selection.Value
End Sub

You could put a button on Sheet2 and assign the macro to that button.
At the
end of that day, say the date is 8/14/2005, you would select all the
cells
starting in B2 and to the right then click the button to convert the
formulas to constants.

Maybe someone will chime in with a more robust way to convert the
formulas
to constants.

Biff

"n0 h4ck1ng"
wrote
in message
...



on sheet1 i have a list of items in col a and in col b i enter the

qty
of those items on a daily basis ex.

.......a..............................b........... ..............
beef................................3............. ......
cod..................................1
chicken............................24

col b is different every day

on sheet 2 i have a list of days in col a col b would be beef col

c
would be cod and col d would be chicken ex....


.........a..........................b............. ............c...................d................. .

..................................beef............ ........cod.................chicken
8/14/05
8/15/05
8/16/05

if today is the 14th i need col b to enter the number for beef on

sheet
1 same for cod ect... than tommarow when i change those #'s on

sheet1 i
need the 14th's # to stay and the new # to go to the 15th keeping a
daily log of those #'s

is this posible please help???

thank you


--
n0 h4ck1ng

------------------------------------------------------------------------
n0 h4ck1ng's Profile:
http://www.excelforum.com/member.php...o&userid=18410
View this thread:

http://www.excelforum.com/showthread...hreadid=395696



--
Bryan Hessey
------------------------------------------------------------------------
Bryan Hessey's Profile: http://www.excelforum.com/member.php...o&userid=21059
View this thread: http://www.excelforum.com/showthread...hreadid=395696

  #4   Report Post  
n0 h4ck1ng
 
Posts: n/a
Default


that worked great but does anyone know of a way to make that value stay
after that day as soon as its entered ... the chart im showing is just
a crude one... it would be to hard to go throught and select 125 cels to
run the macro i was given


--
n0 h4ck1ng
------------------------------------------------------------------------
n0 h4ck1ng's Profile: http://www.excelforum.com/member.php...o&userid=18410
View this thread: http://www.excelforum.com/showthread...hreadid=395696

  #5   Report Post  
n0 h4ck1ng
 
Posts: n/a
Default


is it posible to create a button to lock only the cells that have
returned a value without having to select those cells i want
constant...and without ruining the formulas in the blank cells????


--
n0 h4ck1ng
------------------------------------------------------------------------
n0 h4ck1ng's Profile: http://www.excelforum.com/member.php...o&userid=18410
View this thread: http://www.excelforum.com/showthread...hreadid=395696



  #6   Report Post  
Bryan Hessey
 
Posts: n/a
Default


Was that in response to Biff or to myself? - if to myself then you would
need to specify each range or cell on another row in the macro, but I do
not understand why you would have formula in 'blank cells' if you wish
to overwrite them with figures as requested.


n0 h4ck1ng Wrote:


n0 h4ck1ng that worked great but does anyone know of a way to make that
value stay after that day as soon as its entered ... the chart im
showing is just a crude one... it would be to hard to go throught and
select 125 cels to run the macro i was given


is it posible to create a button to lock only the cells that have
returned a value without having to select those cells i want
constant...and without ruining the formulas in the blank cells????



--
Bryan Hessey
------------------------------------------------------------------------
Bryan Hessey's Profile: http://www.excelforum.com/member.php...o&userid=21059
View this thread: http://www.excelforum.com/showthread...hreadid=395696

  #7   Report Post  
n0 h4ck1ng
 
Posts: n/a
Default


mabey this will help explain my prob. on page one there are 6 cells
looking for data for that day b2....e2.....h2.....k2...etc than on
page 2 there are six more b46.......e46........h46 so on and so on for
23 pages that would be for one day ie the 14th.. on the 15th it would
be the cells right below those all other cell are doing calculations
for that day based on those numbers so ...with 23 pages and all those
single cell it would take a while to select them than run the macro
here is the formula i have in b2 right now

=IF($A1=TODAY(),Sheet1!B2,"")

does this help with what im looking for or am i confused beyond help???
lol

thanx


--
n0 h4ck1ng
------------------------------------------------------------------------
n0 h4ck1ng's Profile: http://www.excelforum.com/member.php...o&userid=18410
View this thread: http://www.excelforum.com/showthread...hreadid=395696

  #8   Report Post  
Bryan Hessey
 
Posts: n/a
Default


If you are using my button you would specify the 'copy from cell' and
the 'copy to cell' once for each item

Then each day after just click the button and it would update the line
according to the day number.

I showed only 3 lines as that was as per your sample, they were

Range("sheet2!a" & dy).Value = Range("sheet1!b3").Value
Range("sheet2!b" & dy).Value = Range("sheet1!b4").Value
Range("sheet2!c" & dy).Value = Range("sheet1!b5").Value

If you have more you would just copy a line and keep pasting and
amending to form a new line, ie, 1 copy and 3 pastes gives

Range("sheet2!c" & dy).Value = Range("sheet1!b5").Value
Range("sheet2!c" & dy).Value = Range("sheet1!b5").Value
Range("sheet2!c" & dy).Value = Range("sheet1!b5").Value

and with a small amount of typing you can amend to the required cells.

You do NOT have to select the cells before pressing the button.

You do need a range of cells that can be entered/calculated for each
Day

Does that help to un-confuse you?



n0 h4ck1ng Wrote:
mabey this will help explain my prob. on page one there are 6 cells
looking for data for that day b2....e2.....h2.....k2...etc than on
page 2 there are six more b46.......e46........h46 so on and so on for
23 pages that would be for one day ie the 14th.. on the 15th it would
be the cells right below those all other cell are doing calculations
for that day based on those numbers so ...with 23 pages and all those
single cell it would take a while to select them than run the macro
here is the formula i have in b2 right now

=IF($A1=TODAY(),Sheet1!B2,"")

does this help with what im looking for or am i confused beyond help???
lol

thanx



--
Bryan Hessey
------------------------------------------------------------------------
Bryan Hessey's Profile: http://www.excelforum.com/member.php...o&userid=21059
View this thread: http://www.excelforum.com/showthread...hreadid=395696

  #9   Report Post  
n0 h4ck1ng
 
Posts: n/a
Default


ahhhh ok i get it now, thank you now if you could tell me how to make
this button and where to enter the code i should have my problem solved
i have toyed around with VBA but have not actualy used it yet

thanks again this solution will take off at least two days worth of
work out of my month
:)


--
n0 h4ck1ng
------------------------------------------------------------------------
n0 h4ck1ng's Profile: http://www.excelforum.com/member.php...o&userid=18410
View this thread: http://www.excelforum.com/showthread...hreadid=395696

  #10   Report Post  
Bryan Hessey
 
Posts: n/a
Default


To create a button, View, Toolbars and ensure Control Toolbox it
ticked.

the first icon on thatt bar reflects 'Edit Mode', click that, then
click the button icon.

click (or double click) in the cell to make a button, and right-mouse
Properties to set a Caption Name "Update Day Figures" and a button back
colour
click View Code and enter the code previously shown.

Then click the 'Edit Mode' icon again (which now shows 'Exit Edit
Mode')

Let me know how you go


n0 h4ck1ng Wrote:
ahhhh ok i get it now, thank you now if you could tell me how to make
this button and where to enter the code i should have my problem solved
i have toyed around with VBA but have not actualy used it yet

thanks again this solution will take off at least two days worth of
work out of my month
:)



--
Bryan Hessey
------------------------------------------------------------------------
Bryan Hessey's Profile: http://www.excelforum.com/member.php...o&userid=21059
View this thread: http://www.excelforum.com/showthread...hreadid=395696

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
Array Formulas take waaaay too long... belly0fdesire Excel Worksheet Functions 7 August 8th 05 10:11 PM
Multiple Formulas Sharon Excel Discussion (Misc queries) 2 February 24th 05 12:49 AM
Re post the exact formulas Juco Excel Worksheet Functions 2 January 31st 05 01:16 AM
How do I sort a column of formulas in Excel? Gordon Excel Discussion (Misc queries) 2 November 27th 04 01:55 AM
How do I sort a column of formulas in Excel? Gordon Excel Discussion (Misc queries) 0 November 26th 04 03:19 PM


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