LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 148
Default how can I do this without actually putting into cells

The following is some code that I have written to help isolate some data
points within a set that corresond to a given date. Currently, the only way
I can get this to work is to enter these calculations into cells and name the
cells so that I can refer to the dates later in the code. Instead of
entering this data into z1:z3, I would like to just have the entered date and
calculated date stored via a public statement. But I am not successful.
How can I change the following to not rely on the cells in column Z?

Range("z1").Select
reviewbeg = InputBox("What date (MM/DD/YYYY) will mark the beginning of
the review period?")
ActiveCell.FormulaR1C1 = reviewbeg
Range("z2").Select

ActiveCell.FormulaR1C1 = _
"=RIGHT(YEAR(R[-1]C),2)&TEXT(R[-1]C-DATE(YEAR(R[-1]C),1,0),""000"")"
ActiveWorkbook.Names.Add Name:="begrevdate", RefersToR1C1:="='new'!R1C26"
ActiveWorkbook.Names.Add Name:="juliandate", RefersToR1C1:="='new'!R2C26"
Range("z3").Select
ActiveCell.FormulaR1C1 = _
"=date(YEAR(begrevdate)-1,month(begrevdate),day(begrevdate))"

TIA
 
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
taking numbers in vertical cells putting them in horizontal cells jhawk22 Excel Worksheet Functions 4 April 28th 10 08:37 PM
Getting a filename into VBA and putting it into cells Babymech Excel Discussion (Misc queries) 2 February 27th 10 01:48 PM
Putting Multiple Cells into 1 FormulaQuestioner Excel Discussion (Misc queries) 10 October 1st 08 06:25 AM
Putting row numbers in cells [email protected] Excel Discussion (Misc queries) 3 November 5th 06 12:53 AM
putting ' in a column of cells Peter McCaul Excel Programming 1 August 14th 04 06:11 PM


All times are GMT +1. The time now is 07:23 AM.

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"