PC Review


Reply
Thread Tools Rate Thread

Code questions

 
 
Ron
Guest
Posts: n/a
 
      12th Jun 2009
Can someone provide:

1. the syntax for copying a complete line from one spreadsheet to another?
Does the second one have to be open?

2. syntax for inserting a complete line in a different spreadsheet, on the
next blank line of a sheet, moving the rest on the lines down?

3. the syntax for copying a complete line at the end of a sheet on a
different spreadsheetspreadsheet.

I'm going to try to use that to put together a complicated macro.

Thanks,

Ron
 
Reply With Quote
 
 
 
 
Jacob Skaria
Guest
Posts: n/a
 
      12th Jun 2009
Ron

Hope the below helps.......


Sub Macro()

Dim wbBook1 As Workbook
Dim wbBook2 As Workbook
Dim wsSheet1 As Worksheet
Dim wsSheet2 As Worksheet
Dim varRange As Variant
Dim lngLastRow As Long

'To reference a open workbook (unsaved)
'To reference a open workbook (already saved) add extension
Set wbBook1 = Workbooks("Book1")
Set wbBook2 = Workbooks("Book3")

'Refer the worksheets
Set wsSheet1 = wbBook1.Worksheets("Sheet2")
Set wsSheet2 = wbBook2.Worksheets("Sheet1")
varRange = wsSheet1.Rows(1)

'To copy to first row
wsSheet2.Rows(1) = varRange

'Next blank cell in Col A
lngLastRow = ActiveSheet.Range("A1").End(xlDown).Row + 1
wsSheet2.Rows(lngLastRow) = varRange

'Last available row in Column A
lngLastRow = ActiveSheet.Cells(Rows.Count, "A").End(xlUp).Row + 1
wsSheet2.Rows(lngLastRow) = varRange
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"Ron" wrote:

> Can someone provide:
>
> 1. the syntax for copying a complete line from one spreadsheet to another?
> Does the second one have to be open?
>
> 2. syntax for inserting a complete line in a different spreadsheet, on the
> next blank line of a sheet, moving the rest on the lines down?
>
> 3. the syntax for copying a complete line at the end of a sheet on a
> different spreadsheetspreadsheet.
>
> I'm going to try to use that to put together a complicated macro.
>
> Thanks,
>
> Ron

 
Reply With Quote
 
Don Guillett
Guest
Posts: n/a
 
      12th Jun 2009
Homework?

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(E-Mail Removed)
"Ron" <(E-Mail Removed)> wrote in message
newsAC76E96-24EB-4432-B69A-(E-Mail Removed)...
> Can someone provide:
>
> 1. the syntax for copying a complete line from one spreadsheet to another?
> Does the second one have to be open?
>
> 2. syntax for inserting a complete line in a different spreadsheet, on the
> next blank line of a sheet, moving the rest on the lines down?
>
> 3. the syntax for copying a complete line at the end of a sheet on a
> different spreadsheetspreadsheet.
>
> I'm going to try to use that to put together a complicated macro.
>
> Thanks,
>
> Ron


 
Reply With Quote
 
Ron
Guest
Posts: n/a
 
      12th Jun 2009
Nah...work work I do at home....and sometimes at work, if I have time...

Actually tried to explain what I needed before, but explanation was too
complicated...no one answered...LOL

My main problem is syntax....once I have that down, I can write the
cludgiest code around....but it (usually) works...LOL

Ron

"Don Guillett" wrote:

> Homework?
>
> --
> Don Guillett
> Microsoft MVP Excel
> SalesAid Software
> (E-Mail Removed)
> "Ron" <(E-Mail Removed)> wrote in message
> newsAC76E96-24EB-4432-B69A-(E-Mail Removed)...
> > Can someone provide:
> >
> > 1. the syntax for copying a complete line from one spreadsheet to another?
> > Does the second one have to be open?
> >
> > 2. syntax for inserting a complete line in a different spreadsheet, on the
> > next blank line of a sheet, moving the rest on the lines down?
> >
> > 3. the syntax for copying a complete line at the end of a sheet on a
> > different spreadsheetspreadsheet.
> >
> > I'm going to try to use that to put together a complicated macro.
> >
> > Thanks,
> >
> > Ron

>
>

 
Reply With Quote
 
Don Guillett
Guest
Posts: n/a
 
      12th Jun 2009
Did Jacob answer all your question

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(E-Mail Removed)
"Ron" <(E-Mail Removed)> wrote in message
news:AD7F7992-0ADF-4345-960E-(E-Mail Removed)...
> Nah...work work I do at home....and sometimes at work, if I have time...
>
> Actually tried to explain what I needed before, but explanation was too
> complicated...no one answered...LOL
>
> My main problem is syntax....once I have that down, I can write the
> cludgiest code around....but it (usually) works...LOL
>
> Ron
>
> "Don Guillett" wrote:
>
>> Homework?
>>
>> --
>> Don Guillett
>> Microsoft MVP Excel
>> SalesAid Software
>> (E-Mail Removed)
>> "Ron" <(E-Mail Removed)> wrote in message
>> newsAC76E96-24EB-4432-B69A-(E-Mail Removed)...
>> > Can someone provide:
>> >
>> > 1. the syntax for copying a complete line from one spreadsheet to
>> > another?
>> > Does the second one have to be open?
>> >
>> > 2. syntax for inserting a complete line in a different spreadsheet, on
>> > the
>> > next blank line of a sheet, moving the rest on the lines down?
>> >
>> > 3. the syntax for copying a complete line at the end of a sheet on a
>> > different spreadsheetspreadsheet.
>> >
>> > I'm going to try to use that to put together a complicated macro.
>> >
>> > Thanks,
>> >
>> > Ron

>>
>>


 
Reply With Quote
 
Ron
Guest
Posts: n/a
 
      15th Jun 2009
Not exactly. The problem I'm having is I'm doing everything by person's
names. Taking a line of code under one person's name and copying it to
another workbook uner that same person's name. I can have the sheets named
after a person or just search down a sheet to find the name and then insert
it in the next blank space.

The biggest problem is storing the person's name, then referring to it in
the next workbook, either in a singal worksheet or a sheet by that name.

Not sure I'm going to be ab;e to make it work.

Thanks,

Ron

"Don Guillett" wrote:

> Did Jacob answer all your question
>
> --
> Don Guillett
> Microsoft MVP Excel
> SalesAid Software
> (E-Mail Removed)
> "Ron" <(E-Mail Removed)> wrote in message
> news:AD7F7992-0ADF-4345-960E-(E-Mail Removed)...
> > Nah...work work I do at home....and sometimes at work, if I have time...
> >
> > Actually tried to explain what I needed before, but explanation was too
> > complicated...no one answered...LOL
> >
> > My main problem is syntax....once I have that down, I can write the
> > cludgiest code around....but it (usually) works...LOL
> >
> > Ron
> >
> > "Don Guillett" wrote:
> >
> >> Homework?
> >>
> >> --
> >> Don Guillett
> >> Microsoft MVP Excel
> >> SalesAid Software
> >> (E-Mail Removed)
> >> "Ron" <(E-Mail Removed)> wrote in message
> >> newsAC76E96-24EB-4432-B69A-(E-Mail Removed)...
> >> > Can someone provide:
> >> >
> >> > 1. the syntax for copying a complete line from one spreadsheet to
> >> > another?
> >> > Does the second one have to be open?
> >> >
> >> > 2. syntax for inserting a complete line in a different spreadsheet, on
> >> > the
> >> > next blank line of a sheet, moving the rest on the lines down?
> >> >
> >> > 3. the syntax for copying a complete line at the end of a sheet on a
> >> > different spreadsheetspreadsheet.
> >> >
> >> > I'm going to try to use that to put together a complicated macro.
> >> >
> >> > Thanks,
> >> >
> >> > Ron
> >>
> >>

>
>

 
Reply With Quote
 
Don Guillett
Guest
Posts: n/a
 
      15th Jun 2009
I'm kinda busy now with a project for a paying client but
If desired, send your file to my address below along with this msg and
a clear explanation of what you want and before/after examples.


--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(E-Mail Removed)
"Ron" <(E-Mail Removed)> wrote in message
news:6BD0BE5C-317D-4E66-AD18-(E-Mail Removed)...
> Not exactly. The problem I'm having is I'm doing everything by person's
> names. Taking a line of code under one person's name and copying it to
> another workbook uner that same person's name. I can have the sheets named
> after a person or just search down a sheet to find the name and then
> insert
> it in the next blank space.
>
> The biggest problem is storing the person's name, then referring to it in
> the next workbook, either in a singal worksheet or a sheet by that name.
>
> Not sure I'm going to be ab;e to make it work.
>
> Thanks,
>
> Ron
>
> "Don Guillett" wrote:
>
>> Did Jacob answer all your question
>>
>> --
>> Don Guillett
>> Microsoft MVP Excel
>> SalesAid Software
>> (E-Mail Removed)
>> "Ron" <(E-Mail Removed)> wrote in message
>> news:AD7F7992-0ADF-4345-960E-(E-Mail Removed)...
>> > Nah...work work I do at home....and sometimes at work, if I have
>> > time...
>> >
>> > Actually tried to explain what I needed before, but explanation was too
>> > complicated...no one answered...LOL
>> >
>> > My main problem is syntax....once I have that down, I can write the
>> > cludgiest code around....but it (usually) works...LOL
>> >
>> > Ron
>> >
>> > "Don Guillett" wrote:
>> >
>> >> Homework?
>> >>
>> >> --
>> >> Don Guillett
>> >> Microsoft MVP Excel
>> >> SalesAid Software
>> >> (E-Mail Removed)
>> >> "Ron" <(E-Mail Removed)> wrote in message
>> >> newsAC76E96-24EB-4432-B69A-(E-Mail Removed)...
>> >> > Can someone provide:
>> >> >
>> >> > 1. the syntax for copying a complete line from one spreadsheet to
>> >> > another?
>> >> > Does the second one have to be open?
>> >> >
>> >> > 2. syntax for inserting a complete line in a different spreadsheet,
>> >> > on
>> >> > the
>> >> > next blank line of a sheet, moving the rest on the lines down?
>> >> >
>> >> > 3. the syntax for copying a complete line at the end of a sheet on a
>> >> > different spreadsheetspreadsheet.
>> >> >
>> >> > I'm going to try to use that to put together a complicated macro.
>> >> >
>> >> > Thanks,
>> >> >
>> >> > Ron
>> >>
>> >>

>>
>>


 
Reply With Quote
 
Ron
Guest
Posts: n/a
 
      16th Jun 2009
I appreciate the offer. I am now automating another process that is going
between spreadsheets and recording it is helping me with some ideas. If I get
really stuck, I may take you up on the offer.

Thanks,

Ron

"Don Guillett" wrote:

> I'm kinda busy now with a project for a paying client but
> If desired, send your file to my address below along with this msg and
> a clear explanation of what you want and before/after examples.
>
>
> --
> Don Guillett
> Microsoft MVP Excel
> SalesAid Software
> (E-Mail Removed)
> "Ron" <(E-Mail Removed)> wrote in message
> news:6BD0BE5C-317D-4E66-AD18-(E-Mail Removed)...
> > Not exactly. The problem I'm having is I'm doing everything by person's
> > names. Taking a line of code under one person's name and copying it to
> > another workbook uner that same person's name. I can have the sheets named
> > after a person or just search down a sheet to find the name and then
> > insert
> > it in the next blank space.
> >
> > The biggest problem is storing the person's name, then referring to it in
> > the next workbook, either in a singal worksheet or a sheet by that name.
> >
> > Not sure I'm going to be ab;e to make it work.
> >
> > Thanks,
> >
> > Ron
> >
> > "Don Guillett" wrote:
> >
> >> Did Jacob answer all your question
> >>
> >> --
> >> Don Guillett
> >> Microsoft MVP Excel
> >> SalesAid Software
> >> (E-Mail Removed)
> >> "Ron" <(E-Mail Removed)> wrote in message
> >> news:AD7F7992-0ADF-4345-960E-(E-Mail Removed)...
> >> > Nah...work work I do at home....and sometimes at work, if I have
> >> > time...
> >> >
> >> > Actually tried to explain what I needed before, but explanation was too
> >> > complicated...no one answered...LOL
> >> >
> >> > My main problem is syntax....once I have that down, I can write the
> >> > cludgiest code around....but it (usually) works...LOL
> >> >
> >> > Ron
> >> >
> >> > "Don Guillett" wrote:
> >> >
> >> >> Homework?
> >> >>
> >> >> --
> >> >> Don Guillett
> >> >> Microsoft MVP Excel
> >> >> SalesAid Software
> >> >> (E-Mail Removed)
> >> >> "Ron" <(E-Mail Removed)> wrote in message
> >> >> newsAC76E96-24EB-4432-B69A-(E-Mail Removed)...
> >> >> > Can someone provide:
> >> >> >
> >> >> > 1. the syntax for copying a complete line from one spreadsheet to
> >> >> > another?
> >> >> > Does the second one have to be open?
> >> >> >
> >> >> > 2. syntax for inserting a complete line in a different spreadsheet,
> >> >> > on
> >> >> > the
> >> >> > next blank line of a sheet, moving the rest on the lines down?
> >> >> >
> >> >> > 3. the syntax for copying a complete line at the end of a sheet on a
> >> >> > different spreadsheetspreadsheet.
> >> >> >
> >> >> > I'm going to try to use that to put together a complicated macro.
> >> >> >
> >> >> > Thanks,
> >> >> >
> >> >> > Ron
> >> >>
> >> >>
> >>
> >>

>
>

 
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
Questions on this code RonaldoOneNil Microsoft Access VBA Modules 4 17th Jul 2009 08:00 PM
Re: 2 Questions about the following code - Please help if you can. Bob Phillips Microsoft Excel Programming 0 4th Jan 2007 11:37 AM
Re: 2 Questions about the following code - Please help if you can. Chris Lewis Microsoft Excel Programming 0 4th Jan 2007 10:10 AM
2 Questions: Code to exit via cmdExit; Code to hide/disable tool b =?Utf-8?B?QW5keUc=?= Microsoft Access 5 22nd Jul 2006 10:24 PM
Questions re your code Jim Russell Microsoft Access Getting Started 1 4th Jul 2003 03:42 PM


Features
 

Advertising
 

Newsgroups
 


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