Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default changing rows for columns


This peice of code goes all the way across the workbook an changes white
blank columns to white columns with IN written on it.

Can anyone adapt this code so that it goes down a column rather than
across a row, i tried changing the words Row to Column but that didn't
work!


VBA:

Sub Macro_In()
Dim c As Range

For Each c In Range(Cells(ActiveCell.Row, 4), Cells(ActiveCell.Row,
56))
If c.Interior.ColorIndex = 2 Or c.Interior.ColorIndex < 0 And
Len(c) = 0 And c.FormulaR1C1 = "" Then
c = "IN"
End If

Next c

End Sub


--
alymcmorland
------------------------------------------------------------------------
alymcmorland's Profile: http://www.excelforum.com/member.php...o&userid=27652
View this thread: http://www.excelforum.com/showthread...hreadid=477143

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default changing rows for columns

Hi,

You are close to the wanted code:

Sub Macro_In()
Dim c As Range

For Each c In Range(Cells(4, ActiveCell.Column), Cells(56,
ActiveCell.Column))
If c.Interior.ColorIndex = 2 Or c.Interior.ColorIndex < 0 And
Len(c) = 0 And c.FormulaR1C1 = "" Then
c = "IN"
End If
Next c

End Sub


Hoop That Helps,


Wouter Magré

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default changing rows for columns


Coll, that works well good, but is there a way instead of it always
being cell 4 to cell 56 that gets changed is there a way to declare the
first cell as the active cell and then do it from there until cell 56?

So if i was on E25 and i ran the macro i'd want all the cells below
E25, so up to E56 to change but i'd have to declare that cell E25 was
the start cell.

Is this possible? and if so how would i go about altering the code to
incorporate it?


--
alymcmorland
------------------------------------------------------------------------
alymcmorland's Profile: http://www.excelforum.com/member.php...o&userid=27652
View this thread: http://www.excelforum.com/showthread...hreadid=477143

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default changing rows for columns

For Each c In Range(Cells(4, ActiveCell.Column), _
Cells(56,ActiveCell.Column))

would become

For Each c In Range(AcitiveCell, Cells(56, _
ActiveCell.Column))

--
Regards,
Tom Ogilvy

"alymcmorland"
wrote in message
news:alymcmorland.1x3v2i_1129651567.1657@excelforu m-nospam.com...

Coll, that works well good, but is there a way instead of it always
being cell 4 to cell 56 that gets changed is there a way to declare the
first cell as the active cell and then do it from there until cell 56?

So if i was on E25 and i ran the macro i'd want all the cells below
E25, so up to E56 to change but i'd have to declare that cell E25 was
the start cell.

Is this possible? and if so how would i go about altering the code to
incorporate it?


--
alymcmorland
------------------------------------------------------------------------
alymcmorland's Profile:

http://www.excelforum.com/member.php...o&userid=27652
View this thread: http://www.excelforum.com/showthread...hreadid=477143



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
Changing Columns to Rows MEAD5432 Excel Discussion (Misc queries) 3 October 31st 07 04:29 PM
Changing from Rows to Columns RayH Excel Discussion (Misc queries) 3 July 23rd 06 05:34 AM
Changing Rows into Columns GaryG Excel Discussion (Misc queries) 12 April 21st 06 12:10 PM
Changing columns into rows Dave Excel Discussion (Misc queries) 3 April 5th 06 12:33 PM
Changing Columns to Rows jenbrunson Excel Discussion (Misc queries) 2 September 14th 05 03:31 PM


All times are GMT +1. The time now is 12:05 AM.

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"