Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Copy Cell Above

Hi All,

I am wondering if anyone would be kind enough to provide me with a
code sample (and maybe a explanation) of how to copy the cell above
the active cell and paste it into the active cell from a macro.

I have tried a few things, but have come no where close, and this
macro, simple as it is, would greatly improve my output as I am
generating pivot tables from data imported from Microsoft Navision.

Thanks
Mick
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Copy Cell Above


ActiveCell.Offset(-1).Copy
ActiveCell.PasteSpecial xlPasteAll
Application.CutCopyMode = Fals

--
Nick
-----------------------------------------------------------------------
Nicke's Profile: http://www.excelforum.com/member.php...nfo&userid=293
View this thread: http://www.excelforum.com/showthread.php?threadid=27110

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 137
Default Copy Cell Above

ActiveCell.Value = ActiveCell.Offset(-1).Value

"Materialised[Work]" wrote:

Hi All,

I am wondering if anyone would be kind enough to provide me with a
code sample (and maybe a explanation) of how to copy the cell above
the active cell and paste it into the active cell from a macro.

I have tried a few things, but have come no where close, and this
macro, simple as it is, would greatly improve my output as I am
generating pivot tables from data imported from Microsoft Navision.

Thanks
Mick

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Copy Cell Above

Hi Mick

Here's a sample:
Sub CopyFromAbove()
On Error GoTo Error
ActiveCell.Value = Cells(ActiveCell.Row - 1, ActiveCell.Column).Value
Error:
Exit Sub
End Sub

CU
Mike

"Materialised[Work]" schrieb im Newsbeitrag
om...
Hi All,

I am wondering if anyone would be kind enough to provide me with a
code sample (and maybe a explanation) of how to copy the cell above
the active cell and paste it into the active cell from a macro.

I have tried a few things, but have come no where close, and this
macro, simple as it is, would greatly improve my output as I am
generating pivot tables from data imported from Microsoft Navision.

Thanks
Mick



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
Code to copy the formulae of one cell to all the cell in the rangewith the specific cell and columnnumber changing Options Yuvraj Excel Discussion (Misc queries) 0 June 29th 09 11:20 AM
Code to copy the formulae of one cell to all the cell in the rangewith the specific cell and columnnumber changing Yuvraj Excel Discussion (Misc queries) 0 June 26th 09 06:01 PM
How can I copy a value from a cell and paste it into another cell while adding it to the previous value in that cell [email protected] Excel Worksheet Functions 2 November 7th 07 09:39 AM
I copy a formula and the results copy from the original cell brooklynsd Excel Discussion (Misc queries) 1 June 23rd 07 01:35 AM
VBA to copy to empty cell directly below a cell when analogous cells in different column have same value as each other? Steven Rosenberg Excel Programming 0 August 5th 03 06:10 AM


All times are GMT +1. The time now is 07:04 AM.

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

About Us

"It's about Microsoft Excel"