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 / January 2008

Tip: Looking for answers? Try searching our database.

Updating Workbook

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
drinese18 - 15 Jan 2008 19:07 GMT
I want to basically create a macro that takes the final information entered
from the main workbook and then insert them or Append to the workbook. Just
like if you would go into an Excel Workbook and it would ask you to Update,
probably from the internet or from a database, I want this workbook to update
from another workbook, can anyone help me with this please?
XP - 15 Jan 2008 20:04 GMT
You didn't give much to go on regarding your needs or how you envision
accomplishing this.

You could:

*Code it so a program opens the other workbook and copies the data
*Link cells to the other workbook
*Use ADO or DAO to make an ODBC connection and import the data

HTH

> I want to basically create a macro that takes the final information entered
> from the main workbook and then insert them or Append to the workbook. Just
> like if you would go into an Excel Workbook and it would ask you to Update,
> probably from the internet or from a database, I want this workbook to update
> from another workbook, can anyone help me with this please?
drinese18 - 15 Jan 2008 21:14 GMT
Ok I'll show you the code I have so far:

Option Explicit

Private Sub CommandButton1_Click()
   Dim rng1 As Range
   Dim rngFound As Range
   
   
   With Worksheets("Index")
       Set rng1 = .Range("A1:A" & .Range("A65536").End(xlDown).Row)
   End With
   Set rngFound = rng1.Find(what:=DateValue(Me.TextBox1.Value))
   Workbooks.Open Filename:="C:\Documents and
Settings\jermaine_wanyou\Desktop\Test_Adagio\CI-Adagio-History-Web.xls"
   Range(rngFound, rngFound.Offset(1, 8)).Copy
Workbooks("CI-Adagio-History-Web.xls").Worksheets("Sheet1").Range("A3114")
   Set rngFound = Nothing
   Unload Me
   End
End Sub

Within the Range section that says "Range A3114", I would like it to check
to see if there is any blank cells or rows after the previous data. If there
isn't then paste the data in the empty cell, if there is data it should tell
me that there is, I was thinking about an If statement but I don't know how
to incorporate it within the code I have

> You didn't give much to go on regarding your needs or how you envision
> accomplishing this.
[quoted text clipped - 12 lines]
> > probably from the internet or from a database, I want this workbook to update
> > from another workbook, can anyone help me with this please?
XP - 15 Jan 2008 21:29 GMT
If you mean you just want to locate the next available cell to paste the data
into safely, without overwriting anything try:

Range("A65536").End(xlUp).Offset(1, 0).Select
<your paste code here>

This should work unless there is danger that the entire spreadsheet is
filled down to row 65536.

HTH

> Ok I'll show you the code I have so far:
>
[quoted text clipped - 40 lines]
> > > probably from the internet or from a database, I want this workbook to update
> > > from another workbook, can anyone help me with this please?
 
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.