PC Review


Reply
Thread Tools Rate Thread

code for storing data

 
 
Maggie
Guest
Posts: n/a
 
      16th Mar 2007
I need help on trying to store data from one worksheet and move it
over to another worksheet row. I have set up an logical table to tell
what cell goes in what row for the worksheet but I do not know how to
command it to store now. For example I want cell A1 in sheet 1 to go
to row A in sheet summary. I am trying to make a database that would
store 50 different items instead of having a worksheet for each item I
want to fill out the form once for each item and move the data over to
the summary sheet. Any help would be appreciated. Thanks!

 
Reply With Quote
 
 
 
 
Ron de Bruin
Guest
Posts: n/a
 
      16th Mar 2007
Start here Maggie
http://www.rondebruin.nl/copy1.htm


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Maggie" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
>I need help on trying to store data from one worksheet and move it
> over to another worksheet row. I have set up an logical table to tell
> what cell goes in what row for the worksheet but I do not know how to
> command it to store now. For example I want cell A1 in sheet 1 to go
> to row A in sheet summary. I am trying to make a database that would
> store 50 different items instead of having a worksheet for each item I
> want to fill out the form once for each item and move the data over to
> the summary sheet. Any help would be appreciated. Thanks!
>

 
Reply With Quote
 
Maggie
Guest
Posts: n/a
 
      20th Mar 2007
On Mar 16, 11:56 am, "Ron de Bruin" <rondebr...@kabelfoon.nl> wrote:
> Start here Maggiehttp://www.rondebruin.nl/copy1.htm
>
> --
>
> Regards Ron de Bruinhttp://www.rondebruin.nl/tips.htm
>
>
>
> "Maggie" <schmidt.marga...@gmail.com> wrote in messagenews:(E-Mail Removed)...
> >I need help on trying to store data from one worksheet and move it
> > over to another worksheet row. I have set up an logical table to tell
> > what cell goes in what row for the worksheet but I do not know how to
> > command it to store now. For example I want cell A1 in sheet 1 to go
> > to row A in sheet summary. I am trying to make a database that would
> > store 50 different items instead of having a worksheet for each item I
> > want to fill out the form once for each item and move the data over to
> > the summary sheet. Any help would be appreciated. Thanks!- Hide quoted text -

>
> - Show quoted text -


I tried to use the code that Ron provided but I still get an error
about the Lr. I But what I am trying to do is store data into another
worksheet in the same workbook.

 
Reply With Quote
 
Ron de Bruin
Guest
Posts: n/a
 
      20th Mar 2007
Copy the function also in the module Maggie

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Maggie" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
> On Mar 16, 11:56 am, "Ron de Bruin" <rondebr...@kabelfoon.nl> wrote:
>> Start here Maggiehttp://www.rondebruin.nl/copy1.htm
>>
>> --
>>
>> Regards Ron de Bruinhttp://www.rondebruin.nl/tips.htm
>>
>>
>>
>> "Maggie" <schmidt.marga...@gmail.com> wrote in messagenews:(E-Mail Removed)...
>> >I need help on trying to store data from one worksheet and move it
>> > over to another worksheet row. I have set up an logical table to tell
>> > what cell goes in what row for the worksheet but I do not know how to
>> > command it to store now. For example I want cell A1 in sheet 1 to go
>> > to row A in sheet summary. I am trying to make a database that would
>> > store 50 different items instead of having a worksheet for each item I
>> > want to fill out the form once for each item and move the data over to
>> > the summary sheet. Any help would be appreciated. Thanks!- Hide quoted text -

>>
>> - Show quoted text -

>
> I tried to use the code that Ron provided but I still get an error
> about the Lr. I But what I am trying to do is store data into another
> worksheet in the same workbook.
>

 
Reply With Quote
 
Maggie
Guest
Posts: n/a
 
      21st Mar 2007
On Mar 20, 6:31 pm, "Ron de Bruin" <rondebr...@kabelfoon.nl> wrote:
> Copy the function also in the module Maggie
>
> --
>
> Regards Ron de Bruinhttp://www.rondebruin.nl/tips.htm
>
>
>
> "Maggie" <schmidt.marga...@gmail.com> wrote in messagenews:(E-Mail Removed)...
> > On Mar 16, 11:56 am, "Ron de Bruin" <rondebr...@kabelfoon.nl> wrote:
> >> Start here Maggiehttp://www.rondebruin.nl/copy1.htm

>
> >> --

>
> >> Regards Ron de Bruinhttp://www.rondebruin.nl/tips.htm

>
> >> "Maggie" <schmidt.marga...@gmail.com> wrote in messagenews:(E-Mail Removed)...
> >> >I need help on trying to store data from one worksheet and move it
> >> > over to another worksheet row. I have set up an logical table to tell
> >> > what cell goes in what row for the worksheet but I do not know how to
> >> > command it to store now. For example I want cell A1 in sheet 1 to go
> >> > to row A in sheet summary. I am trying to make a database that would
> >> > store 50 different items instead of having a worksheet for each item I
> >> > want to fill out the form once for each item and move the data over to
> >> > the summary sheet. Any help would be appreciated. Thanks!- Hide quoted text -

>
> >> - Show quoted text -

>
> > I tried to use the code that Ron provided but I still get an error
> > about the Lr. I But what I am trying to do is store data into another
> > worksheet in the same workbook.- Hide quoted text -

>
> - Show quoted text -


I have the macro copied to both a module and sheet. Here is the code
that I am working with if you could look over it and tell me why I am
still receiving a error I would appreciate it.
Sub copy_1()
Dim sourceRange As Range
Dim destrange As Range
Dim Lr As Long
Lr = LastRow(Sheets("Summary")) + 1
Set sourceRange = Sheets("HOEPAWorksheet").Range("C3:H74")
Set destrange = Sheets("Summary").Range("A:BU" & Lr)
sourceRange.Copy destrange
End Sub


Sub copy_1_Values_PasteSpecial()
Dim sourceRange As Range
Dim destrange As Range
Dim Lr As Long
Application.ScreenUpdating = False
Lr = LastRow(Sheets("Summary")) + 1
Set sourceRange = Sheets("HOEPAWorksheet").Range("C3:H74")
Set destrange = Sheets("Summary").Range("A:BU" & Lr)
sourceRange.Copy
destrange.PasteSpecial xlPasteValues, , False, False
Application.CutCopyMode = False
Application.ScreenUpdating = True
End Sub


Sub copy_1_Values_ValueProperty()
Dim sourceRange As Range
Dim destrange As Range
Dim Lr As Long
Lr = LastRow(Sheets("Summary")) + 1
Set sourceRange = Sheets("HOEPAWorksheet").Range("C3:H74")
With sourceRange
Set destrange = Sheets("Summary").Range("A:BU" & Lr). _
Resize(.Rows.Count, .Columns.Count)
End With
destrange.Value = sourceRange.Value
End Sub


 
Reply With Quote
 
Ron de Bruin
Guest
Posts: n/a
 
      21st Mar 2007
All three macro do the copy only in a different way.

All macros use the LastRow function
See my site

Copy one macro and the function in a normal module(not a sheet module) and try again


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Maggie" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
> On Mar 20, 6:31 pm, "Ron de Bruin" <rondebr...@kabelfoon.nl> wrote:
>> Copy the function also in the module Maggie
>>
>> --
>>
>> Regards Ron de Bruinhttp://www.rondebruin.nl/tips.htm
>>
>>
>>
>> "Maggie" <schmidt.marga...@gmail.com> wrote in messagenews:(E-Mail Removed)...
>> > On Mar 16, 11:56 am, "Ron de Bruin" <rondebr...@kabelfoon.nl> wrote:
>> >> Start here Maggiehttp://www.rondebruin.nl/copy1.htm

>>
>> >> --

>>
>> >> Regards Ron de Bruinhttp://www.rondebruin.nl/tips.htm

>>
>> >> "Maggie" <schmidt.marga...@gmail.com> wrote in messagenews:(E-Mail Removed)...
>> >> >I need help on trying to store data from one worksheet and move it
>> >> > over to another worksheet row. I have set up an logical table to tell
>> >> > what cell goes in what row for the worksheet but I do not know how to
>> >> > command it to store now. For example I want cell A1 in sheet 1 to go
>> >> > to row A in sheet summary. I am trying to make a database that would
>> >> > store 50 different items instead of having a worksheet for each item I
>> >> > want to fill out the form once for each item and move the data over to
>> >> > the summary sheet. Any help would be appreciated. Thanks!- Hide quoted text -

>>
>> >> - Show quoted text -

>>
>> > I tried to use the code that Ron provided but I still get an error
>> > about the Lr. I But what I am trying to do is store data into another
>> > worksheet in the same workbook.- Hide quoted text -

>>
>> - Show quoted text -

>
> I have the macro copied to both a module and sheet. Here is the code
> that I am working with if you could look over it and tell me why I am
> still receiving a error I would appreciate it.
> Sub copy_1()
> Dim sourceRange As Range
> Dim destrange As Range
> Dim Lr As Long
> Lr = LastRow(Sheets("Summary")) + 1
> Set sourceRange = Sheets("HOEPAWorksheet").Range("C3:H74")
> Set destrange = Sheets("Summary").Range("A:BU" & Lr)
> sourceRange.Copy destrange
> End Sub
>
>
> Sub copy_1_Values_PasteSpecial()
> Dim sourceRange As Range
> Dim destrange As Range
> Dim Lr As Long
> Application.ScreenUpdating = False
> Lr = LastRow(Sheets("Summary")) + 1
> Set sourceRange = Sheets("HOEPAWorksheet").Range("C3:H74")
> Set destrange = Sheets("Summary").Range("A:BU" & Lr)
> sourceRange.Copy
> destrange.PasteSpecial xlPasteValues, , False, False
> Application.CutCopyMode = False
> Application.ScreenUpdating = True
> End Sub
>
>
> Sub copy_1_Values_ValueProperty()
> Dim sourceRange As Range
> Dim destrange As Range
> Dim Lr As Long
> Lr = LastRow(Sheets("Summary")) + 1
> Set sourceRange = Sheets("HOEPAWorksheet").Range("C3:H74")
> With sourceRange
> Set destrange = Sheets("Summary").Range("A:BU" & Lr). _
> Resize(.Rows.Count, .Columns.Count)
> End With
> destrange.Value = sourceRange.Value
> End Sub
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
storing code in Add-in mike allen Microsoft Excel Programming 4 28th Jan 2007 08:44 PM
storing a value in code Giselle Microsoft Excel Programming 4 9th May 2006 11:27 AM
storing of VBA code kurt Microsoft Excel Programming 4 13th Jan 2006 06:27 PM
Storing Code Snipets Shayne H Microsoft Dot NET 1 7th Sep 2003 08:54 PM
What is best practice for storing SQL code for an app Microsoft VB .NET 17 5th Sep 2003 04:14 PM


Features
 

Advertising
 

Newsgroups
 


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