Solved

Formula Help

Posted on 2014-01-15
7
276 Views
Last Modified: 2014-01-17
Hello, tyring to get some data to appear on a page.  Here is the formula i have in a vba code need some help fixing it.  Thank You

Sheet18.textbox270.Value = "Current As Of:" & Format(Date, "yyyy-mm-dd hh:MM:ss")
0
Comment
Question by:sandramac
  • 2
  • 2
  • 2
  • +1
7 Comments
 
LVL 11

Expert Comment

by:tel2
ID: 39784337
What does your current code produce, exactly, Sandra?
0
 

Author Comment

by:sandramac
ID: 39784352
I get a method or data member not found.
0
 
LVL 3

Expert Comment

by:Sreeram
ID: 39784651
Are you trying to display the value in a text box control or in a cell.?

Try this:

For cell :

  Activecell.value=Format(Date, "yyyy-mm-dd hh:MM:ss")

Note: you need to format the cell as per your requirement . By right clicking and select formt cells

For Control:
the control name will be unique for the whole work book

textbox270=Format(Date, "yyyy-mm-dd hh:MM:ss")
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 11

Expert Comment

by:tel2
ID: 39786926
Hi kujumbio,

> For cell :
>  Activecell.value=Format(Date, "yyyy-mm-dd hh:MM:ss")
> Note: you need to format the cell as per your requirement . By right clicking and select formt cells

Is there any point in using the Format() function to format data in a cell which is already formatted appropriately?
Why don't we just format the cell (manually, as you suggested), then use a formula like this:
    Activecell.value=Date
0
 
LVL 3

Expert Comment

by:Sreeram
ID: 39787612
Hi tel2

       If you use only date it will be based on the regional setting of the system . what i made is double check for the format.
0
 
LVL 42

Accepted Solution

by:
Rob Jurd, EE MVE earned 500 total points
ID: 39787716
I tried your code and Date only returns the day/month/year component and not the time.  You should use Now with parenthesis eg Now() as it is calling a function returning a value

Sheet18.textbox270.Value = "Current As Of:" & Format(Now(), "yyyy-mm-dd hh:MM:ss")

I've tested with an ActiveX textbox that it looks like you're using.
0
 

Author Closing Comment

by:sandramac
ID: 39790077
Thanks
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
My experience with Windows 10 over a one year period and suggestions for smooth operation
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now