LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default Macro Drop Formula As Far As Required

Hi

I am trying to make a shortcut, but the bit iam missing is quite an
important technical bit that will help me elsewhere.

basically, the shortcut puts a countif formula next to the active cell when
the macro is run e.g. in B2 next to the data in A2. i want it to countif for
the entire range of the data in column A. Then i want to dollar up that range
to lock it & drop the formula down the entire length of column B where there
is data in column A.

The problem i have is that even with the 'relative preference' button
ticked, the code still makes reference to specific cells or range lenghts /
sizes. I want this macro to work on data sets of any type. does anyone know
how to make this more transferable.


here is the basic code so far


ActiveCell.Offset(1, 0).Range("A1").Select
ActiveCell.FormulaR1C1 = "=COUNTIF(R2C8:R10208C8,RC[-1])"
ActiveCell.Select
Selection.AutoFill Destination:=ActiveCell.Range("A1:A10207")
ActiveCell.Range("A1:A10207").Select
ActiveCell.Columns("A:A").EntireColumn.Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
ActiveCell.Offset(1, -1).Range("A1").Select
Application.CutCopyMode = False
ActiveCell.Offset(0, 1).Columns("A:A").EntireColumn.EntireColumn.AutoFi t
End Sub





any help gratefully recieved. please contact for any further info


cheers


jb
 
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
Formula required - possibly macro Ron (Bismark) Excel Discussion (Misc queries) 1 December 14th 06 01:27 PM
Drop down - required field Tim T[_2_] Excel Programming 0 August 10th 05 09:21 PM
Pilgrim needs help: Effecting keystroks required by a macro nested within a macro. [email protected] Excel Programming 1 May 14th 05 03:46 AM
Macro help required Ian Macfarlane Excel Programming 3 May 6th 05 08:29 PM
MACRO HELP REQUIRED PLEASE! Fletch[_3_] Excel Programming 4 March 31st 05 01:46 PM


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