Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default Updating Workbook

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?
  #2   Report Post  
Posted to microsoft.public.excel.programming
XP XP is offline
external usenet poster
 
Posts: 389
Default Updating Workbook

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

"drinese18" wrote:

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?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default Updating Workbook

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

"XP" wrote:

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

"drinese18" wrote:

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?

  #4   Report Post  
Posted to microsoft.public.excel.programming
XP XP is offline
external usenet poster
 
Posts: 389
Default Updating Workbook

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

"drinese18" wrote:

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

"XP" wrote:

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

"drinese18" wrote:

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?

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default Updating Workbook

ok I tried it, I kind a figured it was something of that sort, but my problem
was how do I incorporate it into my code?

"XP" wrote:

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

"drinese18" wrote:

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

"XP" wrote:

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

"drinese18" wrote:

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?



  #6   Report Post  
Posted to microsoft.public.excel.programming
XP XP is offline
external usenet poster
 
Posts: 389
Default Updating Workbook

Try the following, but all as one line (test on a back up copy for safety):

Range(rngFound, rngFound.Offset(1, 8)).Copy
Destination:=Workbooks("CI-Adagio-History-Web.xls").Worksheets("Sheet1").Range("A65536").End (xlUp).Offset(1, 0)

HTH

"drinese18" wrote:

ok I tried it, I kind a figured it was something of that sort, but my problem
was how do I incorporate it into my code?

"XP" wrote:

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

"drinese18" wrote:

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

"XP" wrote:

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

"drinese18" wrote:

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?

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default Updating Workbook

I tried the code and it works up to a point, for the "Destination" object, I
tried declaring it as Excel but it doesn't go through it jus brings up
another error, if I don't declare it, it still brings up an error, what do
you think is wrong?

"XP" wrote:

Try the following, but all as one line (test on a back up copy for safety):

Range(rngFound, rngFound.Offset(1, 8)).Copy
Destination:=Workbooks("CI-Adagio-History-Web.xls").Worksheets("Sheet1").Range("A65536").End (xlUp).Offset(1, 0)

HTH

"drinese18" wrote:

ok I tried it, I kind a figured it was something of that sort, but my problem
was how do I incorporate it into my code?

"XP" wrote:

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

"drinese18" wrote:

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

"XP" wrote:

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

"drinese18" wrote:

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?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Automatically updating a workbook from a different workbook day by not an excel guru Excel Discussion (Misc queries) 4 September 20th 06 03:35 AM
My workbook links are not updating (its 30,000 KB size workbook). rselena Excel Discussion (Misc queries) 1 August 14th 06 09:14 PM
Auto updating a workbook with data from another workbook Richard Excel Discussion (Misc queries) 0 November 6th 05 03:50 PM
updating a workbook Robert Couchman[_4_] Excel Programming 3 February 17th 04 12:57 PM
Transparently updating another workbook from the current workbook lothario[_40_] Excel Programming 3 November 2nd 03 01:58 AM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"