Question about Computers & Internet
Want to know macro code for copying a range of cells from one Excell 2007 worksheet to another worksheet in the same Excell workbook by simply typing the number allotted in the first column of that particular range of cells of first woksheet into first column of the second worksheet.
You did not respond to my claification request. Here is some code that might help, it copies a selection of cells going down until an emty cell is found and across until an emty cell is found. This is form an earlier version of office but should comeclose to woring in 2007.
' copyrange Macro
' Macro written by Royal 11/22/2008.
'save the return values
wksname = ActiveSheet.Name
returncell = ActiveCell.Address
searchfor = ActiveCell.Value
'go to first worksheet and find entered value (note this is a value serach)
findfor = "A1"
On Error Resume Next
findfor = Cells.Find(What:=searchfor, After:=ActiveCell, LookIn:=xlValues, LookAt:= _
xlWhole, SearchOrder:=xlByColumns, SearchDirection:=xlNext, MatchCase:= _
If findfor = "A1" Then
erwks = ActiveSheet.Name
er = MsgBox("Search item not found on Worksheet" + erwks, , "Search Error")
'save this address and start searching for copy area boundaries
begcell = ActiveCell.Address
begcl = ActiveCell.Cells.Column
begri = ActiveCell.Cells.Row
'search amaximum of 1000 rows and 676 columns
endri = begri + 1000
endcl = 26 * 26
maxrow = 0
maxcol = 0
For col = Cells.Column To endcl
If Cells(begri, col) = "" Then
maxcol = col
col = endcl
ri = endri
ri = begri
For ri = ri To (Cells.Row + 1000)
If Cells(ri, col) = "" Then
If ri > maxrow Then
maxrow = ri
ri = endri
maxrow = maxrow - 1
maxcol = maxcol - 1
'copy the selected area
endcell = Cells(maxrow, maxcol).Address
crnge = begcell & ":" & endcell
'go back and paste it in
' use this if yo want to paste formulas etc.
' use this code if you want to paste values instead of formulas etc.
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
Posted on Nov 29, 2008
a 6ya expert can help you resolve that issue over the phone in a minute or two.
best thing about this new service is that you are never placed on hold and get to talk to real repairmen in the US.
the service is completely free and covers almost anything you can think of (from cars to computers, handyman, and even drones).
click here to download the app (for users in the US for now) and get all the help you need.
Posted on Jan 02, 2017
Tips for a great answer:
Mar 18, 2011 | Microsoft EXCEL 2004 for Mac
The default Excel
file format. Cannot store VBA macro code or Microsoft Excel 4.0 macro sheets
(.xlm files in Excel 4.0).
Uses the same basic
XML format as the Excel Workbook, but can store VBA macro code. Users saving
an Excel workbook that has VBA code or Excel 4.0 macro sheets (.xlm files in
Excel 4.0) are prompted to use this file format.
The default file
format for an Excel template. Cannot store VBA macro code or Excel 4.0 macro
sheets (.xlm files in Excel 4.0).
Can contain a
VBAProject part or Excel 4.0 macro sheets (.xlm files in Excel 4.0).
Workbooks created from this template inherit the VBAProject part or Excel 4.0
macro sheets that exist in the template.
program that runs additional code. Excel add-ins use the Open XML file format
to store data, and they support using VBA projects and Excel 4.0 macro
Feb 21, 2011 | Computers & Internet
Oct 29, 2010 | Computers & Internet
Apr 08, 2010 | Microsoft Office Excel 2007
Mar 11, 2009 | Microsoft Computers & Internet
Dec 20, 2008 | Microsoft Computers & Internet
Jul 16, 2008 | Microsoft Office Professional 2007 Full...
432 people viewed this question
Usually answered in minutes!