Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Select and Copy Range using Offset

Hi,

I'm experincing some problems with trying to accomplish the following.

Using Excel as a DB and have exisiting code that will enter a ne
record after the last entry in the list.

Before the Data Entry form is displayed i would like to copy the Cel
Format of the previous columns for the new record column only.

The following activates the first cell of the required range (the lef
most):

ActiveWorkbook.ActiveSheet.Activate
Range("A1").Select
Do
If IsEmpty(ActiveCell) = False Then
ActiveCell.Offset(1, 0).Select
End If
Loop Until IsEmpty(ActiveCell) = True
ActiveCell.Value = txtClarifyRef.Value
ActiveCell.Offset(0, 1) = txtCaseTitle.Value
ActiveCell.Offset(0, 2) = cboOperatingSystem.Value

ActiveCell.Offset(-1, 14).Select

I am hoping to select a range from this ActiveCell to an offset valu
(10 columns along). Copy the formatting (not the values) and apply i
to the row below (but with same column references)

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Select and Copy Range using Offset

Jon,

Try this

cLastRow = Cells(Rows.Count,"A").End(xlUp).Row
Cells(cLastRow,"A").Resize(1,10).Copy
Cells(cLastRow+1,"A").PasteSpecial Paste:=xlPasteFormulas

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"jondorv " wrote in message
...
Hi,

I'm experincing some problems with trying to accomplish the following.

Using Excel as a DB and have exisiting code that will enter a new
record after the last entry in the list.

Before the Data Entry form is displayed i would like to copy the Cell
Format of the previous columns for the new record column only.

The following activates the first cell of the required range (the left
most):

ActiveWorkbook.ActiveSheet.Activate
Range("A1").Select
Do
If IsEmpty(ActiveCell) = False Then
ActiveCell.Offset(1, 0).Select
End If
Loop Until IsEmpty(ActiveCell) = True
ActiveCell.Value = txtClarifyRef.Value
ActiveCell.Offset(0, 1) = txtCaseTitle.Value
ActiveCell.Offset(0, 2) = cboOperatingSystem.Value

ActiveCell.Offset(-1, 14).Select

I am hoping to select a range from this ActiveCell to an offset value
(10 columns along). Copy the formatting (not the values) and apply it
to the row below (but with same column references).


---
Message posted from http://www.ExcelForum.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
Select range then copy rows macro noggins Excel Discussion (Misc queries) 1 October 18th 09 11:06 PM
select a range, copy it to a new sheet Dave F Excel Discussion (Misc queries) 1 September 22nd 06 08:06 PM
How to apply OFFSET as the range in a basic 'Copy' process... cdavidson Excel Discussion (Misc queries) 4 November 8th 05 08:43 PM
How to Select a relative range with Using "Find" and Offset() Dennis Excel Discussion (Misc queries) 7 July 27th 05 03:57 PM
Automatically select range and copy to new sheet Alistair[_2_] Excel Programming 3 October 11th 03 04:33 AM


All times are GMT +1. The time now is 02:20 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"