Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with Formula

Status
Not open for further replies.

Molfetta

Technical User
Apr 16, 2007
3
IT
Hi everybody. I'm an Italian VBA user and I'm tring to create a macro in excel. The problem is: I'd like to insert a formula (=IF(WEEKDAY(....)=....)) in a flexible number of non continuos cells which show dates. The formula in each cell refers to the previous one, except for the first, filled manually. So, for explample, I have 64 days and 35 numeric data per day, and I want it (the macro) to put 63 dates (the first is put by myself), each of them separated from the preceding one by 35 cells. 64 and 35 may change.
I don't know how to compile the code for selecting the right cells and fill them with the formula. Here is my code:
Dim giorni, dati as Integer
giorni = Range("A1").Value 'giorni is the number of days
dati = Range("B1").Value 'dati is the number of data
For x=1 to giorni
Range("C1").select '"C3" is the starting date - filled manually
Range.("C" & dati*x).formula..........

I hope I've been clear. Sorry for my english.
Thanks.
 
Thanks a lot. I'll post it right now.
Best regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top