#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 318
Default loop

I created a macro and it works fine, however I want to add a loop. (Hope
that is the term) I want to be able to go to the last row in the worksheet
and highlight the row in grey and make the font bold .
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,124
Default loop

As ALWAYS, post your coding efforts for comments and suggestions.

--
Don Guillett
SalesAid Software

"Wanna Learn" wrote in message
...
I created a macro and it works fine, however I want to add a loop. (Hope
that is the term) I want to be able to go to the last row in the
worksheet
and highlight the row in grey and make the font bold .



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default loop

Sometimes you don't need to loop.

If you can pick out a column that always has data when the row is used, you can
use that to find the last row.


Dim LastRow as long
With worksheets("Sheet1")
lastrow = .cells(.rows.count,"X").end(xlup).row
'then format .rows(lastrow)
end with




Wanna Learn wrote:

I created a macro and it works fine, however I want to add a loop. (Hope
that is the term) I want to be able to go to the last row in the worksheet
and highlight the row in grey and make the font bold .


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.misc
Raj Raj is offline
external usenet poster
 
Posts: 130
Default loop

Tey this:-
Dim rowNum
Dim colNum
rowNum = Range("a1").End(xlDown).Row
colNum = Range("a1").End(xlDown).End(xlToRight).Column

With Range(Cells(rowNum, 1), Cells(rowNum, colNum))
.Font.Bold = True
.Interior.ColorIndex = 15
End With
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 318
Default loop

Thanks Dave
I copied the macro, but it does not work . My last column that always has
data is Q. I am overlooking something , sorry I just don't get it. Please
clarify

"Dave Peterson" wrote:

Sometimes you don't need to loop.

If you can pick out a column that always has data when the row is used, you can
use that to find the last row.


Dim LastRow as long
With worksheets("Sheet1")
lastrow = .cells(.rows.count,"X").end(xlup).row
'then format .rows(lastrow)
end with




Wanna Learn wrote:

I created a macro and it works fine, however I want to add a loop. (Hope
that is the term) I want to be able to go to the last row in the worksheet
and highlight the row in grey and make the font bold .


--

Dave Peterson



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default loop

What did you use?

And what did you try after you found that last row?

Wanna Learn wrote:

Thanks Dave
I copied the macro, but it does not work . My last column that always has
data is Q. I am overlooking something , sorry I just don't get it. Please
clarify

"Dave Peterson" wrote:

Sometimes you don't need to loop.

If you can pick out a column that always has data when the row is used, you can
use that to find the last row.


Dim LastRow as long
With worksheets("Sheet1")
lastrow = .cells(.rows.count,"X").end(xlup).row
'then format .rows(lastrow)
end with




Wanna Learn wrote:

I created a macro and it works fine, however I want to add a loop. (Hope
that is the term) I want to be able to go to the last row in the worksheet
and highlight the row in grey and make the font bold .


--

Dave Peterson


--

Dave Peterson
  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 318
Default loop



"Wanna Learn" wrote:

Thanks Dave
I copied the macro, but it does not work . My last column that always has
data is Q. I am overlooking something , sorry I just don't get it. Please
clarify

"Dave Peterson" wrote:

Sometimes you don't need to loop.

If you can pick out a column that always has data when the row is used, you can
use that to find the last row.


Dim LastRow as long
With worksheets("Sheet1")
lastrow = .cells(.rows.count,"X").end(xlup).row
'then format .rows(lastrow)
end with




Wanna Learn wrote:

I created a macro and it works fine, however I want to add a loop. (Hope
that is the term) I want to be able to go to the last row in the worksheet
and highlight the row in grey and make the font bold .


--

Dave Peterson

  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 318
Default loop

Good Morning!
It works!
Thank you, thank you Dave . You are great . I had mental block
yesterday. The only thing I did different today was that I deleted the
first two rows in the worksheet that were blank. Again thank you

"Wanna Learn" wrote:

Thanks Dave
I copied the macro, but it does not work . My last column that always has
data is Q. I am overlooking something , sorry I just don't get it. Please
clarify

"Dave Peterson" wrote:

Sometimes you don't need to loop.

If you can pick out a column that always has data when the row is used, you can
use that to find the last row.


Dim LastRow as long
With worksheets("Sheet1")
lastrow = .cells(.rows.count,"X").end(xlup).row
'then format .rows(lastrow)
end with




Wanna Learn wrote:

I created a macro and it works fine, however I want to add a loop. (Hope
that is the term) I want to be able to go to the last row in the worksheet
and highlight the row in grey and make the font bold .


--

Dave Peterson

  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default loop

I'm not sure how this change would have helped--the code starts at the bottom
and works up.

But glad you got it working.

Wanna Learn wrote:

Good Morning!
It works!
Thank you, thank you Dave . You are great . I had mental block
yesterday. The only thing I did different today was that I deleted the
first two rows in the worksheet that were blank. Again thank you

"Wanna Learn" wrote:

Thanks Dave
I copied the macro, but it does not work . My last column that always has
data is Q. I am overlooking something , sorry I just don't get it. Please
clarify

"Dave Peterson" wrote:

Sometimes you don't need to loop.

If you can pick out a column that always has data when the row is used, you can
use that to find the last row.


Dim LastRow as long
With worksheets("Sheet1")
lastrow = .cells(.rows.count,"X").end(xlup).row
'then format .rows(lastrow)
end with




Wanna Learn wrote:

I created a macro and it works fine, however I want to add a loop. (Hope
that is the term) I want to be able to go to the last row in the worksheet
and highlight the row in grey and make the font bold .

--

Dave Peterson


--

Dave Peterson
  #10   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 318
Default loop

Dave
I'm in trouble again

Below is the macro I'm using (the one you gave me) BUT instead of
highlighting the last row it highlights and bolds the first row all the way
across to the last column in the spreadsheet. It should stop around column
Q .. thanks

Dim LastRow As Long
With Worksheets("Sheet1")
LastRow = .Cells(.Rows.Count, "X").End(xlUp).Row
'then format .rows(lastrow)

..Rows(LastRow).Font.Bold = True
.Rows(LastRow).Interior.ColorIndex = 15

End With

End Sub


"Dave Peterson" wrote:

I'm not sure how this change would have helped--the code starts at the bottom
and works up.

But glad you got it working.

Wanna Learn wrote:

Good Morning!
It works!
Thank you, thank you Dave . You are great . I had mental block
yesterday. The only thing I did different today was that I deleted the
first two rows in the worksheet that were blank. Again thank you

"Wanna Learn" wrote:

Thanks Dave
I copied the macro, but it does not work . My last column that always has
data is Q. I am overlooking something , sorry I just don't get it. Please
clarify

"Dave Peterson" wrote:

Sometimes you don't need to loop.

If you can pick out a column that always has data when the row is used, you can
use that to find the last row.


Dim LastRow as long
With worksheets("Sheet1")
lastrow = .cells(.rows.count,"X").end(xlup).row
'then format .rows(lastrow)
end with




Wanna Learn wrote:

I created a macro and it works fine, however I want to add a loop. (Hope
that is the term) I want to be able to go to the last row in the worksheet
and highlight the row in grey and make the font bold .

--

Dave Peterson


--

Dave Peterson



  #11   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default loop

I used column X to determine the last row. Make sure you change that to a
column that you can depend on having data.



Wanna Learn wrote:

Dave
I'm in trouble again

Below is the macro I'm using (the one you gave me) BUT instead of
highlighting the last row it highlights and bolds the first row all the way
across to the last column in the spreadsheet. It should stop around column
Q .. thanks

Dim LastRow As Long
With Worksheets("Sheet1")
LastRow = .Cells(.Rows.Count, "X").End(xlUp).Row
'then format .rows(lastrow)

.Rows(LastRow).Font.Bold = True
.Rows(LastRow).Interior.ColorIndex = 15

End With

End Sub

"Dave Peterson" wrote:

I'm not sure how this change would have helped--the code starts at the bottom
and works up.

But glad you got it working.

Wanna Learn wrote:

Good Morning!
It works!
Thank you, thank you Dave . You are great . I had mental block
yesterday. The only thing I did different today was that I deleted the
first two rows in the worksheet that were blank. Again thank you

"Wanna Learn" wrote:

Thanks Dave
I copied the macro, but it does not work . My last column that always has
data is Q. I am overlooking something , sorry I just don't get it. Please
clarify

"Dave Peterson" wrote:

Sometimes you don't need to loop.

If you can pick out a column that always has data when the row is used, you can
use that to find the last row.


Dim LastRow as long
With worksheets("Sheet1")
lastrow = .cells(.rows.count,"X").end(xlup).row
'then format .rows(lastrow)
end with




Wanna Learn wrote:

I created a macro and it works fine, however I want to add a loop. (Hope
that is the term) I want to be able to go to the last row in the worksheet
and highlight the row in grey and make the font bold .

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson
  #12   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 318
Default loop

Dave
It works great! Yes once I changed that "X" to the last column with data it
worked.
THanks for making my day!

"Dave Peterson" wrote:

I used column X to determine the last row. Make sure you change that to a
column that you can depend on having data.



Wanna Learn wrote:

Dave
I'm in trouble again

Below is the macro I'm using (the one you gave me) BUT instead of
highlighting the last row it highlights and bolds the first row all the way
across to the last column in the spreadsheet. It should stop around column
Q .. thanks

Dim LastRow As Long
With Worksheets("Sheet1")
LastRow = .Cells(.Rows.Count, "X").End(xlUp).Row
'then format .rows(lastrow)

.Rows(LastRow).Font.Bold = True
.Rows(LastRow).Interior.ColorIndex = 15

End With

End Sub

"Dave Peterson" wrote:

I'm not sure how this change would have helped--the code starts at the bottom
and works up.

But glad you got it working.

Wanna Learn wrote:

Good Morning!
It works!
Thank you, thank you Dave . You are great . I had mental block
yesterday. The only thing I did different today was that I deleted the
first two rows in the worksheet that were blank. Again thank you

"Wanna Learn" wrote:

Thanks Dave
I copied the macro, but it does not work . My last column that always has
data is Q. I am overlooking something , sorry I just don't get it. Please
clarify

"Dave Peterson" wrote:

Sometimes you don't need to loop.

If you can pick out a column that always has data when the row is used, you can
use that to find the last row.


Dim LastRow as long
With worksheets("Sheet1")
lastrow = .cells(.rows.count,"X").end(xlup).row
'then format .rows(lastrow)
end with




Wanna Learn wrote:

I created a macro and it works fine, however I want to add a loop. (Hope
that is the term) I want to be able to go to the last row in the worksheet
and highlight the row in grey and make the font bold .

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson

  #13   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default loop

Glad you got it working.

Wanna Learn wrote:

Dave
It works great! Yes once I changed that "X" to the last column with data it
worked.
THanks for making my day!

"Dave Peterson" wrote:

I used column X to determine the last row. Make sure you change that to a
column that you can depend on having data.



Wanna Learn wrote:

Dave
I'm in trouble again

Below is the macro I'm using (the one you gave me) BUT instead of
highlighting the last row it highlights and bolds the first row all the way
across to the last column in the spreadsheet. It should stop around column
Q .. thanks

Dim LastRow As Long
With Worksheets("Sheet1")
LastRow = .Cells(.Rows.Count, "X").End(xlUp).Row
'then format .rows(lastrow)

.Rows(LastRow).Font.Bold = True
.Rows(LastRow).Interior.ColorIndex = 15

End With

End Sub

"Dave Peterson" wrote:

I'm not sure how this change would have helped--the code starts at the bottom
and works up.

But glad you got it working.

Wanna Learn wrote:

Good Morning!
It works!
Thank you, thank you Dave . You are great . I had mental block
yesterday. The only thing I did different today was that I deleted the
first two rows in the worksheet that were blank. Again thank you

"Wanna Learn" wrote:

Thanks Dave
I copied the macro, but it does not work . My last column that always has
data is Q. I am overlooking something , sorry I just don't get it. Please
clarify

"Dave Peterson" wrote:

Sometimes you don't need to loop.

If you can pick out a column that always has data when the row is used, you can
use that to find the last row.


Dim LastRow as long
With worksheets("Sheet1")
lastrow = .cells(.rows.count,"X").end(xlup).row
'then format .rows(lastrow)
end with




Wanna Learn wrote:

I created a macro and it works fine, however I want to add a loop. (Hope
that is the term) I want to be able to go to the last row in the worksheet
and highlight the row in grey and make the font bold .

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson


--

Dave Peterson
  #14   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,124
Default loop

Fun, huh?

--
Don Guillett
SalesAid Software

"Dave Peterson" wrote in message
...
Glad you got it working.

Wanna Learn wrote:

Dave
It works great! Yes once I changed that "X" to the last column with data
it
worked.
THanks for making my day!

"Dave Peterson" wrote:

I used column X to determine the last row. Make sure you change that
to a
column that you can depend on having data.



Wanna Learn wrote:

Dave
I'm in trouble again

Below is the macro I'm using (the one you gave me) BUT instead of
highlighting the last row it highlights and bolds the first row all
the way
across to the last column in the spreadsheet. It should stop
around column
Q .. thanks

Dim LastRow As Long
With Worksheets("Sheet1")
LastRow = .Cells(.Rows.Count, "X").End(xlUp).Row
'then format .rows(lastrow)

.Rows(LastRow).Font.Bold = True
.Rows(LastRow).Interior.ColorIndex = 15

End With

End Sub

"Dave Peterson" wrote:

I'm not sure how this change would have helped--the code starts at
the bottom
and works up.

But glad you got it working.

Wanna Learn wrote:

Good Morning!
It works!
Thank you, thank you Dave . You are great . I had mental
block
yesterday. The only thing I did different today was that I
deleted the
first two rows in the worksheet that were blank. Again thank
you

"Wanna Learn" wrote:

Thanks Dave
I copied the macro, but it does not work . My last column that
always has
data is Q. I am overlooking something , sorry I just don't
get it. Please
clarify

"Dave Peterson" wrote:

Sometimes you don't need to loop.

If you can pick out a column that always has data when the
row is used, you can
use that to find the last row.


Dim LastRow as long
With worksheets("Sheet1")
lastrow = .cells(.rows.count,"X").end(xlup).row
'then format .rows(lastrow)
end with




Wanna Learn wrote:

I created a macro and it works fine, however I want to add
a loop. (Hope
that is the term) I want to be able to go to the last row
in the worksheet
and highlight the row in grey and make the font bold .

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson


--

Dave Peterson



  #15   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default loop

Or just regular life.

Don Guillett wrote:

Fun, huh?

--
Don Guillett
SalesAid Software

"Dave Peterson" wrote in message
...
Glad you got it working.

Wanna Learn wrote:

Dave
It works great! Yes once I changed that "X" to the last column with data
it
worked.
THanks for making my day!

"Dave Peterson" wrote:

I used column X to determine the last row. Make sure you change that
to a
column that you can depend on having data.



Wanna Learn wrote:

Dave
I'm in trouble again

Below is the macro I'm using (the one you gave me) BUT instead of
highlighting the last row it highlights and bolds the first row all
the way
across to the last column in the spreadsheet. It should stop
around column
Q .. thanks

Dim LastRow As Long
With Worksheets("Sheet1")
LastRow = .Cells(.Rows.Count, "X").End(xlUp).Row
'then format .rows(lastrow)

.Rows(LastRow).Font.Bold = True
.Rows(LastRow).Interior.ColorIndex = 15

End With

End Sub

"Dave Peterson" wrote:

I'm not sure how this change would have helped--the code starts at
the bottom
and works up.

But glad you got it working.

Wanna Learn wrote:

Good Morning!
It works!
Thank you, thank you Dave . You are great . I had mental
block
yesterday. The only thing I did different today was that I
deleted the
first two rows in the worksheet that were blank. Again thank
you

"Wanna Learn" wrote:

Thanks Dave
I copied the macro, but it does not work . My last column that
always has
data is Q. I am overlooking something , sorry I just don't
get it. Please
clarify

"Dave Peterson" wrote:

Sometimes you don't need to loop.

If you can pick out a column that always has data when the
row is used, you can
use that to find the last row.


Dim LastRow as long
With worksheets("Sheet1")
lastrow = .cells(.rows.count,"X").end(xlup).row
'then format .rows(lastrow)
end with




Wanna Learn wrote:

I created a macro and it works fine, however I want to add
a loop. (Hope
that is the term) I want to be able to go to the last row
in the worksheet
and highlight the row in grey and make the font bold .

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson


--

Dave Peterson


--

Dave Peterson
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
Loop time seems dependent on unrelated workbook - Why? Richard Excel Worksheet Functions 2 March 30th 06 11:59 PM
Loop gone crazy Dave Peterson Excel Discussion (Misc queries) 4 December 16th 05 03:38 PM
Do Loop Noemi Excel Discussion (Misc queries) 0 December 8th 05 10:43 PM
Help with Do...Loop Noemi Excel Discussion (Misc queries) 1 December 7th 05 12:59 AM
hysteresis loop olivekim Charts and Charting in Excel 1 October 28th 05 04:22 AM


All times are GMT +1. The time now is 12:26 PM.

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"