ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Excel Macros (https://www.excelbanter.com/excel-worksheet-functions/121807-excel-macros.html)

Kelvin9811

Excel Macros
 
I want to create a macro that changes the date in a specific formula. I have
a spreadsheet and I want to find out how many files where received on a
specific date. Any help will be greatly appreciated

Gary''s Student

Excel Macros
 
Let's say your formula in the worksheet is:

=COUNTIF(A$1:A$10,"12/6/2006")

First, without VBA use
=COUNTIF(A$1:A$10,D2) and put the date in D2

or with VBA:

Sub update()
Dim s1 As String, s2 As String, s3 As String

s1 = "=countif($A$1:$A$10,"
s2 = """12/6/2006"""
s3 = ")"
Range("B9").Formula = s1 & s2 & s3
End Sub


and replace s2 as needed or set s2 with an inputbox.

--
Gary's Student


"Kelvin9811" wrote:

I want to create a macro that changes the date in a specific formula. I have
a spreadsheet and I want to find out how many files where received on a
specific date. Any help will be greatly appreciated



All times are GMT +1. The time now is 03:25 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com