Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / March 2008

Tip: Looking for answers? Try searching our database.

Hardcode

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Steve - 21 Mar 2008 19:48 GMT
Hello.  Given the following code, how can I have the result of the
formulas hardcoded?  I tried simply adding .value at the end of each,
but that did not work!  Thanks!

LastRow = Worksheets("Log").Cells(Cells.Rows.Count, "A").End(xlUp).Row

With Worksheets("Log")
   .Range("A" & LastRow + 1).Formula = "='Extended Terms'!C8"
   .Range("B" & LastRow + 1).Formula = "='Extended Terms'!C6"
   .Range("C" & LastRow + 1).Formula = "='Extended Terms'!C5"
   .Range("D" & LastRow + 1).Formula = "='Extended Terms'!C7"
   .Range("E" & LastRow + 1).Formula = "='Extended Terms'!C17"
   .Range("F" & LastRow + 1).Formula = "='Extended Terms'!C23"
   .Range("G" & LastRow + 1).Formula = "='Extended Terms'!C11"
   .Range("H" & LastRow + 1).Formula = "='Extended Terms'!C77"
   .Range("I" & LastRow + 1).Formula = "='Extended Terms'!C12"
   .Range("J" & LastRow + 1).Formula = "='Extended Terms'!I8"
   .Range("K" & LastRow + 1).Formula = "='Extended Terms'!I7"
End With
Don Guillett - 21 Mar 2008 20:05 GMT
Please give YOUR definition of "hardcoded" If you mean you want to leave the
values instead of the formulas then
either change to values when finished

.Range(cells("A",LastRow + 1),cells("k",lastrow+1)).value = _
.Range(cells("A",LastRow + 1),cells("k",lastrow+1)).value

or this idea

.Range("A" & LastRow + 1).value= sheets("Extended Terms").range("C8")

Signature

Don Guillett
Microsoft MVP Excel
SalesAid Software
dguillett1@austin.rr.com

> Hello.  Given the following code, how can I have the result of the
> formulas hardcoded?  I tried simply adding .value at the end of each,
[quoted text clipped - 15 lines]
>    .Range("K" & LastRow + 1).Formula = "='Extended Terms'!I7"
> End With
Dave Peterson - 21 Mar 2008 20:18 GMT
Instead of lines like this:

.Range("A" & LastRow + 1).Formula = "='Extended Terms'!C8"

You could use:
.Range("A" & LastRow + 1).value = worksheets("extended terms").range("C8").value

Depending on what's in those cells, you may want:

with .Range("A" & LastRow + 1)
  .numberformat = worksheets("extended terms").range("C8").numberformat
  .value = worksheets("extended terms").range("C8").value
end with

> Hello.  Given the following code, how can I have the result of the
> formulas hardcoded?  I tried simply adding .value at the end of each,
[quoted text clipped - 15 lines]
>     .Range("K" & LastRow + 1).Formula = "='Extended Terms'!I7"
> End With

Signature

Dave Peterson

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.