Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 846
Default VBA help (Time crunch) please help

I am trying to write conditional formatting for four conditions. I know that
will require a Do Loop however I need to write code for the Range to be
formatted. The Range I am looking for is A1:IV 64000. I am starting with
just the range selection code. I have tried Range.SelectAll, Range "A1:IV
64000".Select and keep getting errors. I know I am close but can't figure
out where I am getting it wrong. Please help
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,090
Default VBA help (Time crunch) please help

Not sure what you are doing or what your current code looks like, but there
should not be a space between, "IV" and "64000". If you need more, post
your code as well as the details of the error you are getting. When you get
an error message, click on the "Debug" button in the error box. This takes
you to the offending line of your code. Include that line in your post.
HTH Otto
"Brad" wrote in message
...
I am trying to write conditional formatting for four conditions. I know
that
will require a Do Loop however I need to write code for the Range to be
formatted. The Range I am looking for is A1:IV 64000. I am starting with
just the range selection code. I have tried Range.SelectAll, Range
"A1:IV
64000".Select and keep getting errors. I know I am close but can't figure
out where I am getting it wrong. Please help



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 846
Default VBA help (Time crunch) please help

Otto here is my struggle. I haven't worked in VBA for several years. I am
importing data into excel and I need to take that data move a column (column
L)into first column position, sort that column in ascending order and then
set up conditional row formatting on values in a certain column (column H).
The data import will be done weekly so the range of the data will grow each
week not to exceed 63500. I am really stuggling. Can you get me started in
the right direction.

"Otto Moehrbach" wrote:

Not sure what you are doing or what your current code looks like, but there
should not be a space between, "IV" and "64000". If you need more, post
your code as well as the details of the error you are getting. When you get
an error message, click on the "Debug" button in the error box. This takes
you to the offending line of your code. Include that line in your post.
HTH Otto
"Brad" wrote in message
...
I am trying to write conditional formatting for four conditions. I know
that
will require a Do Loop however I need to write code for the Range to be
formatted. The Range I am looking for is A1:IV 64000. I am starting with
just the range selection code. I have tried Range.SelectAll, Range
"A1:IV
64000".Select and keep getting errors. I know I am close but can't figure
out where I am getting it wrong. Please help




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 272
Default VBA help (Time crunch) please help

Brad, try this for starters:
Sub ManipulateData()
Dim lCell as Range
Columns("L").Cut
Columns("A").Insert
Set lCell = FindLastCell
With Range("A1",lCell).
.Sort Key1:=Range("A2"), Order1:=xlAscending,_
Header:=xlGuess, OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom, DataOption1:=xlSortNormal
.FormatConditions.Delete
.FormatConditions.Add Type:=xlExpression, Formula1:="=$H1<0.5"
.FormatConditions(1).Interior.ColorIndex = 4
End With
End Sub

Function FindLastCell() As Range
Dim LastColumn As Integer
Dim LastRow As Long
Dim LastCell As Range
If WorksheetFunction.CountA(Cells) 0 Then
'Search for any entry, by searching backwards by Rows.
LastRow = Cells.Find(What:="*", After:=[A1], _
SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious).Row
'Search for any entry, by searching backwards by Columns.
LastColumn = Cells.Find(What:="*", After:=[A1], _
SearchOrder:=xlByColumns, _
SearchDirection:=xlPrevious).Column
Set FindLastCell = Cells(LastRow, LastColumn)
Else
Set FindLastCell = Range("A1")
End If
End Function

--
Charles Chickering

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


"Brad" wrote:

Otto here is my struggle. I haven't worked in VBA for several years. I am
importing data into excel and I need to take that data move a column (column
L)into first column position, sort that column in ascending order and then
set up conditional row formatting on values in a certain column (column H).
The data import will be done weekly so the range of the data will grow each
week not to exceed 63500. I am really stuggling. Can you get me started in
the right direction.

"Otto Moehrbach" wrote:

Not sure what you are doing or what your current code looks like, but there
should not be a space between, "IV" and "64000". If you need more, post
your code as well as the details of the error you are getting. When you get
an error message, click on the "Debug" button in the error box. This takes
you to the offending line of your code. Include that line in your post.
HTH Otto
"Brad" wrote in message
...
I am trying to write conditional formatting for four conditions. I know
that
will require a Do Loop however I need to write code for the Range to be
formatted. The Range I am looking for is A1:IV 64000. I am starting with
just the range selection code. I have tried Range.SelectAll, Range
"A1:IV
64000".Select and keep getting errors. I know I am close but can't figure
out where I am getting it wrong. Please help




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
Time calculations for Scheduled Time vs. Actual Time Worked The Caterer Excel Discussion (Misc queries) 1 November 29th 09 08:08 AM
straight time, time and a half, and double time Jeremy Excel Discussion (Misc queries) 3 September 23rd 08 09:03 PM
Calculate Ending time using Start Time and Elapsed Time Chief 711 Excel Worksheet Functions 5 May 13th 08 04:34 PM
Tough number crunch! Arty Morty Excel Discussion (Misc queries) 3 March 1st 06 02:16 AM
Calculating days & time left from start date/time to end date/time marie Excel Worksheet Functions 7 December 7th 05 02:36 PM


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