Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Paste into next blank row in a different worksheet

I need to copy a row of data from worksheet1 to the next available row in
worksheet2. Worksheet1 cells (A2:K2) display results from a 'LOOKUP' function
and cells (L2:AB2) in worksheet1 utilize the 'IF' function to display
results from worksheet3. I only want the results from the LOOKUP and IF
functions to populate the next available row in worksheet2.
I'd like to utilize the 'CommandButton' that I've programed witha macro to
clear the contents of worksheet3 to initialize or complete the transfer of
data from worksheet1 to worksheet2. Or will that happen automatically when I
clear the data from worksheet3?
--
dhunter43
The Performance Advantage, LLC
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Paste into next blank row in a different worksheet

You have to clear sheet3. Hre is some code that may help

Sub Macro2()
'
' Macro2 Macro
' Macro recorded 7/25/2007
'

'
Sheets("Sheet1").Select
Rows("20:20").Select
Selection.Copy
Sheets("Sheet2").Select
LastRow = Cells(Rows.Count, "A").End(xlUp).Row + 1
Rows(LastRow & ":" & LastRow).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False

Sheets("Sheet3").Range("B5").EntireRow.ClearConten ts

End Sub


"dhunter43" wrote:

I need to copy a row of data from worksheet1 to the next available row in
worksheet2. Worksheet1 cells (A2:K2) display results from a 'LOOKUP' function
and cells (L2:AB2) in worksheet1 utilize the 'IF' function to display
results from worksheet3. I only want the results from the LOOKUP and IF
functions to populate the next available row in worksheet2.
I'd like to utilize the 'CommandButton' that I've programed witha macro to
clear the contents of worksheet3 to initialize or complete the transfer of
data from worksheet1 to worksheet2. Or will that happen automatically when I
clear the data from worksheet3?
--
dhunter43
The Performance Advantage, LLC

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Paste into next blank row in a different worksheet

I am receiving a "Compile Error: Syntax error" when I try to run this macro.
The hilighted copy is
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,

I associated the macro with the 'CommandButton' I placed in worksheet3, is
that the right place for it?
I appreciate your assistance. I need to log off in a few minutes to get to
work but will look for your response when I get home tonight.
Thank you,
--
dhunter43
The Performance Advantage, LLC


"Joel" wrote:

You have to clear sheet3. Hre is some code that may help

Sub Macro2()
'
' Macro2 Macro
' Macro recorded 7/25/2007
'

'
Sheets("Sheet1").Select
Rows("20:20").Select
Selection.Copy
Sheets("Sheet2").Select
LastRow = Cells(Rows.Count, "A").End(xlUp).Row + 1
Rows(LastRow & ":" & LastRow).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False

Sheets("Sheet3").Range("B5").EntireRow.ClearConten ts

End Sub


"dhunter43" wrote:

I need to copy a row of data from worksheet1 to the next available row in
worksheet2. Worksheet1 cells (A2:K2) display results from a 'LOOKUP' function
and cells (L2:AB2) in worksheet1 utilize the 'IF' function to display
results from worksheet3. I only want the results from the LOOKUP and IF
functions to populate the next available row in worksheet2.
I'd like to utilize the 'CommandButton' that I've programed witha macro to
clear the contents of worksheet3 to initialize or complete the transfer of
data from worksheet1 to worksheet2. Or will that happen automatically when I
clear the data from worksheet3?
--
dhunter43
The Performance Advantage, LLC

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Paste into next blank row in a different worksheet

The proble has tto due with line wrapping. When code is pasted on this
website the length is too long and then when it is pasted in VBA it gives an
error

Sub Macro2()
'
' Macro2 Macro
' Macro recorded 7/25/2007
'

'
Sheets("Sheet1").Select
Rows("20:20").Select
Selection.Copy
Sheets("Sheet2").Select
LastRow = Cells(Rows.Count, "A").End(xlUp).Row + 1
Rows(LastRow & ":" & LastRow).Select
Selection.PasteSpecial Paste:=xlPasteValues, _
Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False

Sheets("Sheet3").Range("B5").EntireRow.ClearConten ts

End Sub



"dhunter43" wrote:

I am receiving a "Compile Error: Syntax error" when I try to run this macro.
The hilighted copy is
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,

I associated the macro with the 'CommandButton' I placed in worksheet3, is
that the right place for it?
I appreciate your assistance. I need to log off in a few minutes to get to
work but will look for your response when I get home tonight.
Thank you,
--
dhunter43
The Performance Advantage, LLC


"Joel" wrote:

You have to clear sheet3. Hre is some code that may help

Sub Macro2()
'
' Macro2 Macro
' Macro recorded 7/25/2007
'

'
Sheets("Sheet1").Select
Rows("20:20").Select
Selection.Copy
Sheets("Sheet2").Select
LastRow = Cells(Rows.Count, "A").End(xlUp).Row + 1
Rows(LastRow & ":" & LastRow).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False

Sheets("Sheet3").Range("B5").EntireRow.ClearConten ts

End Sub


"dhunter43" wrote:

I need to copy a row of data from worksheet1 to the next available row in
worksheet2. Worksheet1 cells (A2:K2) display results from a 'LOOKUP' function
and cells (L2:AB2) in worksheet1 utilize the 'IF' function to display
results from worksheet3. I only want the results from the LOOKUP and IF
functions to populate the next available row in worksheet2.
I'd like to utilize the 'CommandButton' that I've programed witha macro to
clear the contents of worksheet3 to initialize or complete the transfer of
data from worksheet1 to worksheet2. Or will that happen automatically when I
clear the data from worksheet3?
--
dhunter43
The Performance Advantage, LLC

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Paste into next blank row in a different worksheet

For some reason this line of code only copies to row19 even though there are
blank rows above it. It would be ok if it pasted data to row20 next and so on
but all data is pasted to row19 over and over again.

LastRow = Cells(Rows.Count, "a").End(xlUp).Row + 1
ActiveSheet.Rows(LastRow & ":" & LastRow).Select

I cannot figure out where the problem is.
Thank you
--
dhunter43
The Performance Advantage, LLC


"Joel" wrote:

The proble has tto due with line wrapping. When code is pasted on this
website the length is too long and then when it is pasted in VBA it gives an
error

Sub Macro2()
'
' Macro2 Macro
' Macro recorded 7/25/2007
'

'
Sheets("Sheet1").Select
Rows("20:20").Select
Selection.Copy
Sheets("Sheet2").Select
LastRow = Cells(Rows.Count, "A").End(xlUp).Row + 1
Rows(LastRow & ":" & LastRow).Select
Selection.PasteSpecial Paste:=xlPasteValues, _
Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False

Sheets("Sheet3").Range("B5").EntireRow.ClearConten ts

End Sub



"dhunter43" wrote:

I am receiving a "Compile Error: Syntax error" when I try to run this macro.
The hilighted copy is
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,

I associated the macro with the 'CommandButton' I placed in worksheet3, is
that the right place for it?
I appreciate your assistance. I need to log off in a few minutes to get to
work but will look for your response when I get home tonight.
Thank you,
--
dhunter43
The Performance Advantage, LLC


"Joel" wrote:

You have to clear sheet3. Hre is some code that may help

Sub Macro2()
'
' Macro2 Macro
' Macro recorded 7/25/2007
'

'
Sheets("Sheet1").Select
Rows("20:20").Select
Selection.Copy
Sheets("Sheet2").Select
LastRow = Cells(Rows.Count, "A").End(xlUp).Row + 1
Rows(LastRow & ":" & LastRow).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False

Sheets("Sheet3").Range("B5").EntireRow.ClearConten ts

End Sub


"dhunter43" wrote:

I need to copy a row of data from worksheet1 to the next available row in
worksheet2. Worksheet1 cells (A2:K2) display results from a 'LOOKUP' function
and cells (L2:AB2) in worksheet1 utilize the 'IF' function to display
results from worksheet3. I only want the results from the LOOKUP and IF
functions to populate the next available row in worksheet2.
I'd like to utilize the 'CommandButton' that I've programed witha macro to
clear the contents of worksheet3 to initialize or complete the transfer of
data from worksheet1 to worksheet2. Or will that happen automatically when I
clear the data from worksheet3?
--
dhunter43
The Performance Advantage, LLC



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Paste into next blank row in a different worksheet

Try this. the code was using the selected range on sheet one for pasting the
cells on sheett 2.

Sub Macro2()
'
' Macro2 Macro
' Macro recorded 7/25/2007
'

'
Sheets("Sheet1").Rows("20:20").Select
Selection.Copy
LastRow = Sheets("Sheet2"). _
Cells(Rows.Count, "A").End(xlUp).Row + 1
Sheets("Sheet2").Rows(LastRow & ":" & LastRow).Select
Selection.PasteSpecial Paste:=xlPasteValues, _
Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False

Sheets("Sheet3").Range("B5").EntireRow.ClearConten ts

End Sub


"dhunter43" wrote:

For some reason this line of code only copies to row19 even though there are
blank rows above it. It would be ok if it pasted data to row20 next and so on
but all data is pasted to row19 over and over again.

LastRow = Cells(Rows.Count, "a").End(xlUp).Row + 1
ActiveSheet.Rows(LastRow & ":" & LastRow).Select

I cannot figure out where the problem is.
Thank you
--
dhunter43
The Performance Advantage, LLC


"Joel" wrote:

The proble has tto due with line wrapping. When code is pasted on this
website the length is too long and then when it is pasted in VBA it gives an
error

Sub Macro2()
'
' Macro2 Macro
' Macro recorded 7/25/2007
'

'
Sheets("Sheet1").Select
Rows("20:20").Select
Selection.Copy
Sheets("Sheet2").Select
LastRow = Cells(Rows.Count, "A").End(xlUp).Row + 1
Rows(LastRow & ":" & LastRow).Select
Selection.PasteSpecial Paste:=xlPasteValues, _
Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False

Sheets("Sheet3").Range("B5").EntireRow.ClearConten ts

End Sub



"dhunter43" wrote:

I am receiving a "Compile Error: Syntax error" when I try to run this macro.
The hilighted copy is
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,

I associated the macro with the 'CommandButton' I placed in worksheet3, is
that the right place for it?
I appreciate your assistance. I need to log off in a few minutes to get to
work but will look for your response when I get home tonight.
Thank you,
--
dhunter43
The Performance Advantage, LLC


"Joel" wrote:

You have to clear sheet3. Hre is some code that may help

Sub Macro2()
'
' Macro2 Macro
' Macro recorded 7/25/2007
'

'
Sheets("Sheet1").Select
Rows("20:20").Select
Selection.Copy
Sheets("Sheet2").Select
LastRow = Cells(Rows.Count, "A").End(xlUp).Row + 1
Rows(LastRow & ":" & LastRow).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False

Sheets("Sheet3").Range("B5").EntireRow.ClearConten ts

End Sub


"dhunter43" wrote:

I need to copy a row of data from worksheet1 to the next available row in
worksheet2. Worksheet1 cells (A2:K2) display results from a 'LOOKUP' function
and cells (L2:AB2) in worksheet1 utilize the 'IF' function to display
results from worksheet3. I only want the results from the LOOKUP and IF
functions to populate the next available row in worksheet2.
I'd like to utilize the 'CommandButton' that I've programed witha macro to
clear the contents of worksheet3 to initialize or complete the transfer of
data from worksheet1 to worksheet2. Or will that happen automatically when I
clear the data from worksheet3?
--
dhunter43
The Performance Advantage, LLC

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Paste into next blank row in a different worksheet

results are no different.
--
dhunter43
The Performance Advantage, LLC


"Joel" wrote:

Try this. the code was using the selected range on sheet one for pasting the
cells on sheett 2.

Sub Macro2()
'
' Macro2 Macro
' Macro recorded 7/25/2007
'

'
Sheets("Sheet1").Rows("20:20").Select
Selection.Copy
LastRow = Sheets("Sheet2"). _
Cells(Rows.Count, "A").End(xlUp).Row + 1
Sheets("Sheet2").Rows(LastRow & ":" & LastRow).Select
Selection.PasteSpecial Paste:=xlPasteValues, _
Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False

Sheets("Sheet3").Range("B5").EntireRow.ClearConten ts

End Sub


"dhunter43" wrote:

For some reason this line of code only copies to row19 even though there are
blank rows above it. It would be ok if it pasted data to row20 next and so on
but all data is pasted to row19 over and over again.

LastRow = Cells(Rows.Count, "a").End(xlUp).Row + 1
ActiveSheet.Rows(LastRow & ":" & LastRow).Select

I cannot figure out where the problem is.
Thank you
--
dhunter43
The Performance Advantage, LLC


"Joel" wrote:

The proble has tto due with line wrapping. When code is pasted on this
website the length is too long and then when it is pasted in VBA it gives an
error

Sub Macro2()
'
' Macro2 Macro
' Macro recorded 7/25/2007
'

'
Sheets("Sheet1").Select
Rows("20:20").Select
Selection.Copy
Sheets("Sheet2").Select
LastRow = Cells(Rows.Count, "A").End(xlUp).Row + 1
Rows(LastRow & ":" & LastRow).Select
Selection.PasteSpecial Paste:=xlPasteValues, _
Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False

Sheets("Sheet3").Range("B5").EntireRow.ClearConten ts

End Sub



"dhunter43" wrote:

I am receiving a "Compile Error: Syntax error" when I try to run this macro.
The hilighted copy is
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,

I associated the macro with the 'CommandButton' I placed in worksheet3, is
that the right place for it?
I appreciate your assistance. I need to log off in a few minutes to get to
work but will look for your response when I get home tonight.
Thank you,
--
dhunter43
The Performance Advantage, LLC


"Joel" wrote:

You have to clear sheet3. Hre is some code that may help

Sub Macro2()
'
' Macro2 Macro
' Macro recorded 7/25/2007
'

'
Sheets("Sheet1").Select
Rows("20:20").Select
Selection.Copy
Sheets("Sheet2").Select
LastRow = Cells(Rows.Count, "A").End(xlUp).Row + 1
Rows(LastRow & ":" & LastRow).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False

Sheets("Sheet3").Range("B5").EntireRow.ClearConten ts

End Sub


"dhunter43" wrote:

I need to copy a row of data from worksheet1 to the next available row in
worksheet2. Worksheet1 cells (A2:K2) display results from a 'LOOKUP' function
and cells (L2:AB2) in worksheet1 utilize the 'IF' function to display
results from worksheet3. I only want the results from the LOOKUP and IF
functions to populate the next available row in worksheet2.
I'd like to utilize the 'CommandButton' that I've programed witha macro to
clear the contents of worksheet3 to initialize or complete the transfer of
data from worksheet1 to worksheet2. Or will that happen automatically when I
clear the data from worksheet3?
--
dhunter43
The Performance Advantage, LLC

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Paste into next blank row in a different worksheet

I tested this and it works fine. Changge the activation of the worksheets

Sub Macro2()
'
' Macro2 Macro
' Macro recorded 7/25/2007
'

'
Sheets("Sheet1").Activate
Rows("20:20").Select
Selection.Copy
Sheets("Sheet2").Activate
LastRow = Sheets("Sheet2"). _
Cells(Rows.Count, "A").End(xlUp).Row + 1
Rows(LastRow & ":" & LastRow).Select
Selection.PasteSpecial Paste:=xlPasteValues, _
Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False

Sheets("Sheet3").Range("B5").EntireRow.ClearConten ts

End Sub


"dhunter43" wrote:

results are no different.
--
dhunter43
The Performance Advantage, LLC


"Joel" wrote:

Try this. the code was using the selected range on sheet one for pasting the
cells on sheett 2.

Sub Macro2()
'
' Macro2 Macro
' Macro recorded 7/25/2007
'

'
Sheets("Sheet1").Rows("20:20").Select
Selection.Copy
LastRow = Sheets("Sheet2"). _
Cells(Rows.Count, "A").End(xlUp).Row + 1
Sheets("Sheet2").Rows(LastRow & ":" & LastRow).Select
Selection.PasteSpecial Paste:=xlPasteValues, _
Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False

Sheets("Sheet3").Range("B5").EntireRow.ClearConten ts

End Sub


"dhunter43" wrote:

For some reason this line of code only copies to row19 even though there are
blank rows above it. It would be ok if it pasted data to row20 next and so on
but all data is pasted to row19 over and over again.

LastRow = Cells(Rows.Count, "a").End(xlUp).Row + 1
ActiveSheet.Rows(LastRow & ":" & LastRow).Select

I cannot figure out where the problem is.
Thank you
--
dhunter43
The Performance Advantage, LLC


"Joel" wrote:

The proble has tto due with line wrapping. When code is pasted on this
website the length is too long and then when it is pasted in VBA it gives an
error

Sub Macro2()
'
' Macro2 Macro
' Macro recorded 7/25/2007
'

'
Sheets("Sheet1").Select
Rows("20:20").Select
Selection.Copy
Sheets("Sheet2").Select
LastRow = Cells(Rows.Count, "A").End(xlUp).Row + 1
Rows(LastRow & ":" & LastRow).Select
Selection.PasteSpecial Paste:=xlPasteValues, _
Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False

Sheets("Sheet3").Range("B5").EntireRow.ClearConten ts

End Sub



"dhunter43" wrote:

I am receiving a "Compile Error: Syntax error" when I try to run this macro.
The hilighted copy is
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,

I associated the macro with the 'CommandButton' I placed in worksheet3, is
that the right place for it?
I appreciate your assistance. I need to log off in a few minutes to get to
work but will look for your response when I get home tonight.
Thank you,
--
dhunter43
The Performance Advantage, LLC


"Joel" wrote:

You have to clear sheet3. Hre is some code that may help

Sub Macro2()
'
' Macro2 Macro
' Macro recorded 7/25/2007
'

'
Sheets("Sheet1").Select
Rows("20:20").Select
Selection.Copy
Sheets("Sheet2").Select
LastRow = Cells(Rows.Count, "A").End(xlUp).Row + 1
Rows(LastRow & ":" & LastRow).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False

Sheets("Sheet3").Range("B5").EntireRow.ClearConten ts

End Sub


"dhunter43" wrote:

I need to copy a row of data from worksheet1 to the next available row in
worksheet2. Worksheet1 cells (A2:K2) display results from a 'LOOKUP' function
and cells (L2:AB2) in worksheet1 utilize the 'IF' function to display
results from worksheet3. I only want the results from the LOOKUP and IF
functions to populate the next available row in worksheet2.
I'd like to utilize the 'CommandButton' that I've programed witha macro to
clear the contents of worksheet3 to initialize or complete the transfer of
data from worksheet1 to worksheet2. Or will that happen automatically when I
clear the data from worksheet3?
--
dhunter43
The Performance Advantage, LLC

  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Paste into next blank row in a different worksheet

Using some input from Excel help I added some text to a couple of lines. The
following code is working.

Sheets("Formulas").Activate
Sheets("formulas").Rows(2).Select
Selection.Copy
Sheets("OperationalRates").Activate
LastRow = Sheets("OperationalRates"). _
Cells(Rows.Count, "A").End(xlUp).Row + 1
Sheets("OperationalRates").Rows(LastRow & ":" & LastRow).Select
Selection.PasteSpecial Paste:=xlPasteValues, _
Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False

Sheets("InputForm").Range("c2:c10").ClearContents

I appreciate your assistance and even moreso your patience. I've learned a
great deal from you and this experience. The more I've learned the more I
want to know.

Thank You!!!!

--
dhunter43
The Performance Advantage, LLC


"Joel" wrote:

I tested this and it works fine. Changge the activation of the worksheets

Sub Macro2()
'
' Macro2 Macro
' Macro recorded 7/25/2007
'

'
Sheets("Sheet1").Activate
Rows("20:20").Select
Selection.Copy
Sheets("Sheet2").Activate
LastRow = Sheets("Sheet2"). _
Cells(Rows.Count, "A").End(xlUp).Row + 1
Rows(LastRow & ":" & LastRow).Select
Selection.PasteSpecial Paste:=xlPasteValues, _
Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False

Sheets("Sheet3").Range("B5").EntireRow.ClearConten ts

End Sub


"dhunter43" wrote:

results are no different.
--
dhunter43
The Performance Advantage, LLC


"Joel" wrote:

Try this. the code was using the selected range on sheet one for pasting the
cells on sheett 2.

Sub Macro2()
'
' Macro2 Macro
' Macro recorded 7/25/2007
'

'
Sheets("Sheet1").Rows("20:20").Select
Selection.Copy
LastRow = Sheets("Sheet2"). _
Cells(Rows.Count, "A").End(xlUp).Row + 1
Sheets("Sheet2").Rows(LastRow & ":" & LastRow).Select
Selection.PasteSpecial Paste:=xlPasteValues, _
Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False

Sheets("Sheet3").Range("B5").EntireRow.ClearConten ts

End Sub


"dhunter43" wrote:

For some reason this line of code only copies to row19 even though there are
blank rows above it. It would be ok if it pasted data to row20 next and so on
but all data is pasted to row19 over and over again.

LastRow = Cells(Rows.Count, "a").End(xlUp).Row + 1
ActiveSheet.Rows(LastRow & ":" & LastRow).Select

I cannot figure out where the problem is.
Thank you
--
dhunter43
The Performance Advantage, LLC


"Joel" wrote:

The proble has tto due with line wrapping. When code is pasted on this
website the length is too long and then when it is pasted in VBA it gives an
error

Sub Macro2()
'
' Macro2 Macro
' Macro recorded 7/25/2007
'

'
Sheets("Sheet1").Select
Rows("20:20").Select
Selection.Copy
Sheets("Sheet2").Select
LastRow = Cells(Rows.Count, "A").End(xlUp).Row + 1
Rows(LastRow & ":" & LastRow).Select
Selection.PasteSpecial Paste:=xlPasteValues, _
Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False

Sheets("Sheet3").Range("B5").EntireRow.ClearConten ts

End Sub



"dhunter43" wrote:

I am receiving a "Compile Error: Syntax error" when I try to run this macro.
The hilighted copy is
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,

I associated the macro with the 'CommandButton' I placed in worksheet3, is
that the right place for it?
I appreciate your assistance. I need to log off in a few minutes to get to
work but will look for your response when I get home tonight.
Thank you,
--
dhunter43
The Performance Advantage, LLC


"Joel" wrote:

You have to clear sheet3. Hre is some code that may help

Sub Macro2()
'
' Macro2 Macro
' Macro recorded 7/25/2007
'

'
Sheets("Sheet1").Select
Rows("20:20").Select
Selection.Copy
Sheets("Sheet2").Select
LastRow = Cells(Rows.Count, "A").End(xlUp).Row + 1
Rows(LastRow & ":" & LastRow).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False

Sheets("Sheet3").Range("B5").EntireRow.ClearConten ts

End Sub


"dhunter43" wrote:

I need to copy a row of data from worksheet1 to the next available row in
worksheet2. Worksheet1 cells (A2:K2) display results from a 'LOOKUP' function
and cells (L2:AB2) in worksheet1 utilize the 'IF' function to display
results from worksheet3. I only want the results from the LOOKUP and IF
functions to populate the next available row in worksheet2.
I'd like to utilize the 'CommandButton' that I've programed witha macro to
clear the contents of worksheet3 to initialize or complete the transfer of
data from worksheet1 to worksheet2. Or will that happen automatically when I
clear the data from worksheet3?
--
dhunter43
The Performance Advantage, LLC

  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 396
Default Paste into next blank row in a different worksheet

Hi dhunter43,

just your code reduced slightly:

Sub test()
'
Dim lastRow As Long
lastRow = Sheets("OperationalRates"). _
Cells(Rows.Count, "A").End(xlUp).Row + 1
Sheets("Formulas").Activate
Sheets("formulas").Rows(2).Copy
Sheets("OperationalRates").Rows(lastRow & ":" & lastRow).PasteSpecial
Paste _
:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False,
Transpose:=False
Sheets("InputForm").Range("C2:C10").ClearContents
End Sub


Best regards,

Les Stout

*** Sent via Developersdex http://www.developersdex.com ***


  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Paste into next blank row in a different worksheet

Thank you, I will rename the workbook and try this code. I appreciate all the
help I"ve been getting and am always looking for opportunities to learn.
--
dhunter43
The Performance Advantage, LLC


"Les Stout" wrote:

Hi dhunter43,

just your code reduced slightly:

Sub test()
'
Dim lastRow As Long
lastRow = Sheets("OperationalRates"). _
Cells(Rows.Count, "A").End(xlUp).Row + 1
Sheets("Formulas").Activate
Sheets("formulas").Rows(2).Copy
Sheets("OperationalRates").Rows(lastRow & ":" & lastRow).PasteSpecial
Paste _
:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False,
Transpose:=False
Sheets("InputForm").Range("C2:C10").ClearContents
End Sub


Best regards,

Les Stout

*** Sent via Developersdex http://www.developersdex.com ***

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
Need macro to check if cell is not blank & previous cell is blank, copy information from row above & paste JenIT Excel Programming 4 April 12th 07 08:56 PM
Macro copy and paste = blank worksheet efface Excel Discussion (Misc queries) 1 April 27th 06 09:52 PM
How to find first blank row to paste to? Judy Ward Excel Programming 1 August 26th 05 12:48 AM
I want a blank space on a worksheet when the question is blank? Patrizia Excel Discussion (Misc queries) 2 June 23rd 05 12:51 AM
Copying and pasting a worksheet to a blank and removing blank rows Bob Reynolds[_3_] Excel Programming 0 June 24th 04 02:55 PM


All times are GMT +1. The time now is 09:57 PM.

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

About Us

"It's about Microsoft Excel"