Search : in
By :

Offset Property

Last answer on Dec 26, 2008 6:31:26 am GMT Mithun, on Dec 26, 2008 6:12:32 am GMT 
 Report this message to moderators

Hello,

I am trying to create a Macro that sizes itself up using the adjacent column and the paste it. Simply to use it for a Pivot table for example, here I am adding a column called Quarter and populating it with Q1. Any ideas would be greatly appreciated!!

Sub zxxx()
Range("A1").Select
Selection.End(xlToRight).Select
ActiveCell.Offset(0, 1).Select
ActiveCell.Select
ActiveCell.FormulaR1C1 = "Quarter"
ActiveCell.Offset(0, -1).Select
Selection.End(xlDown).Select
ActiveCell.Offset(0, 1).Select
ActiveCell.Select
ActiveCell.FormulaR1C1 = "Q1"
ActiveCell.Select
Selection.Copy
Range(Selection, Selection.End(xlUp)).Select
Range("Offset(1, 0)", "Select.SpecialCells(xlCellTypeLastCell)").Select
ActiveSheet.Paste
End Sub

Configuration: Windows Vista
Firefox 3.0.5

Best answers for « Offset Property » in :
Offset of sound and image of a video file (Divx) Show Offset of sound and image of a video file (Divx) The shifting of sound and image of Divx, mkv or other files , may be due to the following factors: Computer / DivX not efficient enough. Try to test the file on a more powerful...
[Javascript]Knowing the height of an HTML element Show [Javascript]Knowing the height of an HTML element To determine the height of a HTML block using JavaScript, independently from the type browsers used, there are two methods: element.offsetHeight...
Modifying the height of element HTML ShowModifying the height of element HTML The style property “height” can be used to modify the height of an html element in javascript. For this you can refer to the following: Below is an indication of how to do this...
Change the appearance of the cursor in CSS ShowChance the appearance of yhe cursor with CSS The cursor property allow you to change the appearance of the cursor on an element of a web page. The client will automatically display the cursor on his computer that matches the type of...
Display Add/Remove Programs ShowDisplay Add/Remove Programs Solution When trying to uninstall a program in the add/remove programs, below error message appears on your screen: An unexpected error occurred Object does not support this property or method...
CSS - Style sheets ShowFont properties Property Value Description font-family Specific font (Arial, Times, Verdana) Familly (serif, sans-serif, fantasy, monospace, cursive) Defines one or more font names or font families. If multiple fonts are defined,...
The Vigenre cipher ShowThe Vigenre cipher The Vigenre cipher is a symmetric cryptosystem, which means it uses the same key for encryption and decryption. The Vigenre cipher closely resembles the Caesar cipher, with the exception that it uses a longer key to offset the...

1

 Mithun, on Dec 26, 2008 6:31:26 am GMT

Hi Guys, I cracked it !!

If you know a easier method - Please let me know..

Sub zxxx()
Range("A1").Select
Selection.End(xlToRight).Select
ActiveCell.Offset(0, 1).Select
ActiveCell.Select
ActiveCell.FormulaR1C1 = "Quarter"
ActiveCell.Offset(0, -1).Select
Selection.End(xlDown).Select
ActiveCell.Offset(0, 1).Select
ActiveCell.Select
ActiveCell.FormulaR1C1 = "Q1"
ActiveCell.Select
Selection.Copy
Range(Selection, Selection.End(xlUp).Offset(1, 0)).Select
ActiveSheet.Paste
End Sub

Reply to Mithun