• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 383
  • Last Modified:

Google spreadsheet

Hi All,

I have 3 sheets.
The rows B-G contain dates.
Row A contains Keywords.
The dates in each row are based on the dates entered in Column B.

I want sheet 4 to display the contents of the A rows of all 3 sheets IF the date is today….

Please find the attached excel sheet downloaded from google docs .

  • 3
  • 2
1 Solution
The easiest way is by using a macro

Sub UpdateSheet(tableNo As Integer)
  Dim RowDate
  Dim NowDate
  Dim RowNumber As Integer
  Dim Heading As String
  RowNumber = 2
  For Each rw In ActiveSheet.Rows
    Heading = rw.Cells(1, 1).Value
    If Heading <> "" Then
        RowDate = Int(rw.Cells(1, 2).Value)
        NowDate = Int(Now)
        If RowDate = NowDate Then
            ThisWorkbook.Sheets(4).Cells(RowNumber, tableNo).Value = Heading
            RowNumber = RowNumber + 1
        End If
    End If

End Sub

Sub UpdateTable()

    Call UpdateSheet(1)
    Call UpdateSheet(2)
    Call UpdateSheet(3)

End Sub

Open in new window

You can then either call UpdateTable when the sheet loads, or set it up to be run on a hot key
magentoAuthor Commented:

If its an excel sheet i know how to add that macro . Is it possible to add them under google spreadsheet ? If so how ?

magentoAuthor Commented:
I created a module and pasted ur code and hit F5 , Nothing happened. Please advice.
Firstly, it is just an excel spread sheet, or at least that's what you posted. I was able to open it in excel.

I have attached your supplied spreadsheet with my code.

Click View-Macros - View Macro. You may have to enable Macros to be able to see it. You can then click on the play button and the macro will run.
magentoAuthor Commented:
Thank you .
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now