#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default rows

how can i select a whole row minus the first few columns?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 272
Default rows

I'll go with the general belief that "few" = 3. If this needs changed, change
the constant "FewRow"

Sub SelectMostOfRow()
Const FewRow As Long = 3
Range("A1").EntireRow.Resize(, _
Columns.Count - FewRow).Offset(, FewRow).Select
End Sub
--
Charles Chickering

"A good example is twice the value of good advice."


"lifeguardernie" wrote:

how can i select a whole row minus the first few columns?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default rows

this works but how do i stick this in as a range for formulas

"Charles Chickering" wrote:

I'll go with the general belief that "few" = 3. If this needs changed, change
the constant "FewRow"

Sub SelectMostOfRow()
Const FewRow As Long = 3
Range("A1").EntireRow.Resize(, _
Columns.Count - FewRow).Offset(, FewRow).Select
End Sub
--
Charles Chickering

"A good example is twice the value of good advice."


"lifeguardernie" wrote:

how can i select a whole row minus the first few columns?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 272
Default rows

I'm not entirely sure that I know what you're asking but if you want to use
the address of those cells in a formula, try something like this:
Sub MakeFormula()
Const FewRow As Long = 3
Dim r1 As Range
Set r1 = Range("A1").EntireRow.Resize(, _
Columns.Count - FewRow).Offset(, FewRow)
'If you want to set a column to the sum of the cells,
'increment with the row, try this:
Range("A1:A2").Formula = "=Sum(" & r1.Address(False, True) & ")"

End Sub
--
Charles Chickering

"A good example is twice the value of good advice."


"lifeguardernie" wrote:

this works but how do i stick this in as a range for formulas

"Charles Chickering" wrote:

I'll go with the general belief that "few" = 3. If this needs changed, change
the constant "FewRow"

Sub SelectMostOfRow()
Const FewRow As Long = 3
Range("A1").EntireRow.Resize(, _
Columns.Count - FewRow).Offset(, FewRow).Select
End Sub
--
Charles Chickering

"A good example is twice the value of good advice."


"lifeguardernie" wrote:

how can i select a whole row minus the first few columns?

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default rows

lets say i want to count all the times 'a' comes up
so i write out =countif (1:1,"a") and i get a message that i created a circle
how do i input the range to be all but the first 3 columns?


"Charles Chickering" wrote:

I'm not entirely sure that I know what you're asking but if you want to use
the address of those cells in a formula, try something like this:
Sub MakeFormula()
Const FewRow As Long = 3
Dim r1 As Range
Set r1 = Range("A1").EntireRow.Resize(, _
Columns.Count - FewRow).Offset(, FewRow)
'If you want to set a column to the sum of the cells,
'increment with the row, try this:
Range("A1:A2").Formula = "=Sum(" & r1.Address(False, True) & ")"

End Sub
--
Charles Chickering

"A good example is twice the value of good advice."


"lifeguardernie" wrote:

this works but how do i stick this in as a range for formulas

"Charles Chickering" wrote:

I'll go with the general belief that "few" = 3. If this needs changed, change
the constant "FewRow"

Sub SelectMostOfRow()
Const FewRow As Long = 3
Range("A1").EntireRow.Resize(, _
Columns.Count - FewRow).Offset(, FewRow).Select
End Sub
--
Charles Chickering

"A good example is twice the value of good advice."


"lifeguardernie" wrote:

how can i select a whole row minus the first few columns?



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 272
Default rows

Pretty much the same.

Dim r1 As Range
Set r1 = Range("A1").EntireRow.Resize(, _
Columns.Count - FewRow).Offset(, FewRow)
'If you want to set a column to the sum of the cells,
'increment with the row, try this:
Range("A1:A2").Formula = "=CountIf(" & r1.Address(False, True) & ",""a"")"

End Sub
--
Charles Chickering

"A good example is twice the value of good advice."


"lifeguardernie" wrote:

lets say i want to count all the times 'a' comes up
so i write out =countif (1:1,"a") and i get a message that i created a circle
how do i input the range to be all but the first 3 columns?


"Charles Chickering" wrote:

I'm not entirely sure that I know what you're asking but if you want to use
the address of those cells in a formula, try something like this:
Sub MakeFormula()
Const FewRow As Long = 3
Dim r1 As Range
Set r1 = Range("A1").EntireRow.Resize(, _
Columns.Count - FewRow).Offset(, FewRow)
'If you want to set a column to the sum of the cells,
'increment with the row, try this:
Range("A1:A2").Formula = "=Sum(" & r1.Address(False, True) & ")"

End Sub
--
Charles Chickering

"A good example is twice the value of good advice."


"lifeguardernie" wrote:

this works but how do i stick this in as a range for formulas

"Charles Chickering" wrote:

I'll go with the general belief that "few" = 3. If this needs changed, change
the constant "FewRow"

Sub SelectMostOfRow()
Const FewRow As Long = 3
Range("A1").EntireRow.Resize(, _
Columns.Count - FewRow).Offset(, FewRow).Select
End Sub
--
Charles Chickering

"A good example is twice the value of good advice."


"lifeguardernie" wrote:

how can i select a whole row minus the first few columns?

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
colating multi rows of data into single rows - no to pivot tables! UKMAN Excel Worksheet Functions 4 March 12th 10 04:11 PM
Enabling option „Format rows“ to hide/unhide rows using VBA-code? ran58 Excel Discussion (Misc queries) 0 July 28th 09 03:46 PM
Counting characters in multiple rows when rows meet specific criteria news.virginmedia.com Excel Worksheet Functions 3 June 28th 08 09:03 PM
"Add/Remove Rows Code" adds rows on grouped sheets, but won't remove rows. Conan Kelly Excel Programming 1 November 16th 07 10:41 PM
Pivot Tables: How do I show ALL field rows, including empty rows?? [email protected] Excel Worksheet Functions 2 April 8th 05 06:21 PM


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