Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I have a workbook containing a worksheet called List and many worksheet
templates. I need a macro to select cells A1:H100 on any of the worksheet templates, copy all data within this range but only if A1:A100 is not blank, and then paste the data on the worksheet called List. Ill use a button to activate the macro on each individual worksheet template. When the user activates the macro on the first template, the data will be copied and pasted to the List starting at cell A1. When the user activates the macro on any of the subsequent templates, the data will copied and pasted on the list starting at the next empty row in column A. In other words, I want the user to be able to add data to the list from any of the templates. I dont have much experience with vba therefore, any help for a novice to apply this would be greatly appreciated. Thanks in advance, Tom |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Try this. Post back if you need more. HTH Otto
Sub CopyData() Dim Dest As Range If Application.CountA(Range("A1:A100")) 0 Then With Sheets("List") Set Dest = .Range("A" & Rows.Count).End(xlUp).Offset(1) Range("A1:H100").Copy Dest End With End If End Sub "tomhelle" wrote in message ... I have a workbook containing a worksheet called List and many worksheet templates. I need a macro to select cells A1:H100 on any of the worksheet templates, copy all data within this range but only if A1:A100 is not blank, and then paste the data on the worksheet called List. Ill use a button to activate the macro on each individual worksheet template. When the user activates the macro on the first template, the data will be copied and pasted to the List starting at cell A1. When the user activates the macro on any of the subsequent templates, the data will copied and pasted on the list starting at the next empty row in column A. In other words, I want the user to be able to add data to the list from any of the templates. I dont have much experience with vba therefore, any help for a novice to apply this would be greatly appreciated. Thanks in advance, Tom |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi Otto,
This is going to work GREAT but I forgot to mention that it needs to paste as "paste special values". That way, I can get the raw data without any formats, etc. Thanks so much for your help! Tom "Otto Moehrbach" wrote: Try this. Post back if you need more. HTH Otto Sub CopyData() Dim Dest As Range If Application.CountA(Range("A1:A100")) 0 Then With Sheets("List") Set Dest = .Range("A" & Rows.Count).End(xlUp).Offset(1) Range("A1:H100").Copy Dest End With End If End Sub "tomhelle" wrote in message ... I have a workbook containing a worksheet called List and many worksheet templates. I need a macro to select cells A1:H100 on any of the worksheet templates, copy all data within this range but only if A1:A100 is not blank, and then paste the data on the worksheet called List. Ill use a button to activate the macro on each individual worksheet template. When the user activates the macro on the first template, the data will be copied and pasted to the List starting at cell A1. When the user activates the macro on any of the subsequent templates, the data will copied and pasted on the list starting at the next empty row in column A. In other words, I want the user to be able to add data to the list from any of the templates. I dont have much experience with vba therefore, any help for a novice to apply this would be greatly appreciated. Thanks in advance, Tom . |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Try this. HTH Otto
Sub CopyData() Dim Dest As Range If Application.CountA(Range("A1:A100")) 0 Then Application.ScreenUpdating = False With Sheets("List") Set Dest = .Range("A" & Rows.Count).End(xlUp).Offset(1) Range("A1:H100").Copy Dest.PasteSpecial xlPasteValues End With Application.ScreenUpdating = True End If End Sub "tomhelle" wrote in message ... Hi Otto, This is going to work GREAT but I forgot to mention that it needs to paste as "paste special values". That way, I can get the raw data without any formats, etc. Thanks so much for your help! Tom "Otto Moehrbach" wrote: Try this. Post back if you need more. HTH Otto Sub CopyData() Dim Dest As Range If Application.CountA(Range("A1:A100")) 0 Then With Sheets("List") Set Dest = .Range("A" & Rows.Count).End(xlUp).Offset(1) Range("A1:H100").Copy Dest End With End If End Sub "tomhelle" wrote in message ... I have a workbook containing a worksheet called List and many worksheet templates. I need a macro to select cells A1:H100 on any of the worksheet templates, copy all data within this range but only if A1:A100 is not blank, and then paste the data on the worksheet called List. Ill use a button to activate the macro on each individual worksheet template. When the user activates the macro on the first template, the data will be copied and pasted to the List starting at cell A1. When the user activates the macro on any of the subsequent templates, the data will copied and pasted on the list starting at the next empty row in column A. In other words, I want the user to be able to add data to the list from any of the templates. I dont have much experience with vba therefore, any help for a novice to apply this would be greatly appreciated. Thanks in advance, Tom . |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thank you so much Otto! That worked beautiful!!
"Otto Moehrbach" wrote: Try this. HTH Otto Sub CopyData() Dim Dest As Range If Application.CountA(Range("A1:A100")) 0 Then Application.ScreenUpdating = False With Sheets("List") Set Dest = .Range("A" & Rows.Count).End(xlUp).Offset(1) Range("A1:H100").Copy Dest.PasteSpecial xlPasteValues End With Application.ScreenUpdating = True End If End Sub "tomhelle" wrote in message ... Hi Otto, This is going to work GREAT but I forgot to mention that it needs to paste as "paste special values". That way, I can get the raw data without any formats, etc. Thanks so much for your help! Tom "Otto Moehrbach" wrote: Try this. Post back if you need more. HTH Otto Sub CopyData() Dim Dest As Range If Application.CountA(Range("A1:A100")) 0 Then With Sheets("List") Set Dest = .Range("A" & Rows.Count).End(xlUp).Offset(1) Range("A1:H100").Copy Dest End With End If End Sub "tomhelle" wrote in message ... I have a workbook containing a worksheet called List and many worksheet templates. I need a macro to select cells A1:H100 on any of the worksheet templates, copy all data within this range but only if A1:A100 is not blank, and then paste the data on the worksheet called List. Ill use a button to activate the macro on each individual worksheet template. When the user activates the macro on the first template, the data will be copied and pasted to the List starting at cell A1. When the user activates the macro on any of the subsequent templates, the data will copied and pasted on the list starting at the next empty row in column A. In other words, I want the user to be able to add data to the list from any of the templates. I dont have much experience with vba therefore, any help for a novice to apply this would be greatly appreciated. Thanks in advance, Tom . . |
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
You're welcome. Thanks for the feedback. Otto
"tomhelle" wrote in message ... Thank you so much Otto! That worked beautiful!! "Otto Moehrbach" wrote: Try this. HTH Otto Sub CopyData() Dim Dest As Range If Application.CountA(Range("A1:A100")) 0 Then Application.ScreenUpdating = False With Sheets("List") Set Dest = .Range("A" & Rows.Count).End(xlUp).Offset(1) Range("A1:H100").Copy Dest.PasteSpecial xlPasteValues End With Application.ScreenUpdating = True End If End Sub "tomhelle" wrote in message ... Hi Otto, This is going to work GREAT but I forgot to mention that it needs to paste as "paste special values". That way, I can get the raw data without any formats, etc. Thanks so much for your help! Tom "Otto Moehrbach" wrote: Try this. Post back if you need more. HTH Otto Sub CopyData() Dim Dest As Range If Application.CountA(Range("A1:A100")) 0 Then With Sheets("List") Set Dest = .Range("A" & Rows.Count).End(xlUp).Offset(1) Range("A1:H100").Copy Dest End With End If End Sub "tomhelle" wrote in message ... I have a workbook containing a worksheet called List and many worksheet templates. I need a macro to select cells A1:H100 on any of the worksheet templates, copy all data within this range but only if A1:A100 is not blank, and then paste the data on the worksheet called List. Ill use a button to activate the macro on each individual worksheet template. When the user activates the macro on the first template, the data will be copied and pasted to the List starting at cell A1. When the user activates the macro on any of the subsequent templates, the data will copied and pasted on the list starting at the next empty row in column A. In other words, I want the user to be able to add data to the list from any of the templates. I dont have much experience with vba therefore, any help for a novice to apply this would be greatly appreciated. Thanks in advance, Tom . . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
macro to create list | Excel Discussion (Misc queries) | |||
Create list with macro | Excel Discussion (Misc queries) | |||
Create a Macro with a List | Excel Worksheet Functions | |||
Create a macro with a list | Excel Worksheet Functions | |||
How to create a macro that compares a list to another list | New Users to Excel |