Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Newbie help with cell reference


Hi all,

I am literally creating my first macro in Excel 2002 and ran into a
problem already. Course it's not as complicated as the others I was
viewing; so even though I'm risking looking very dumb, at least it
should be easy.

I have a client that created a macro to type a word or words in a cell
(ex. A1), then go to the next cell (B1) and type another word and keep
going til the last cell (H1). However she wants to be able to do this
macro on any row (ex. A3 - H3)

I viewed the macro and it specifically references the cells. So I
removed that reference in the visual basic window, but then the macro
typed each word over top of each other in the same cell. I'm so green,
that I don't even know the command to go to the next cell and didn't
see it referenced in help. Any ideas? BTW I'm pasting the actual macro
below in case I didn't type that well.

Thanks,
Carla

Sub TitleBar()
'
' TitleBar Macro
' Budget Title Bar
'
' Keyboard Shortcut: Ctrl+t
'
Range("A3:H3").Select
Selection.Font.Underline = xlUnderlineStyleSingle
Selection.Font.Bold = True
Range("A3").Select
ActiveCell.FormulaR1C1 = "Project"
Range("B3").Select
ActiveCell.FormulaR1C1 = "Task"
Range("C3").Select
ActiveCell.FormulaR1C1 = "Expnd Type"
Range("D3").Select
ActiveCell.FormulaR1C1 = "Item Date"
Range("E3").Select
ActiveCell.FormulaR1C1 = "Supplier"
Range("F3").Select
ActiveCell.FormulaR1C1 = "Burden Cost"
Range("G3").Select
ActiveCell.FormulaR1C1 = "Comment"
Range("H3").Select
ActiveCell.FormulaR1C1 = "Expnd Org"
Range("I3").Select
End Sub


---
~~ Message posted from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default Newbie help with cell reference

I don't understand. Your macro fills in the blanks in the cells indicated.
If you want to fill in the rest of the active row with these words use
something like
actrivecell.offset(,1)="Project"
actrivecell.offset(,2)="Task"
etc

If you are saying it is desired to go one cell to the right, just use the
right arrow key.

--
Don Guillett
SalesAid Software

"carlab68" wrote in message
...

Hi all,

I am literally creating my first macro in Excel 2002 and ran into a
problem already. Course it's not as complicated as the others I was
viewing; so even though I'm risking looking very dumb, at least it
should be easy.

I have a client that created a macro to type a word or words in a cell
(ex. A1), then go to the next cell (B1) and type another word and keep
going til the last cell (H1). However she wants to be able to do this
macro on any row (ex. A3 - H3)

I viewed the macro and it specifically references the cells. So I
removed that reference in the visual basic window, but then the macro
typed each word over top of each other in the same cell. I'm so green,
that I don't even know the command to go to the next cell and didn't
see it referenced in help. Any ideas? BTW I'm pasting the actual macro
below in case I didn't type that well.

Thanks,
Carla

Sub TitleBar()
'
' TitleBar Macro
' Budget Title Bar
'
' Keyboard Shortcut: Ctrl+t
'
Range("A3:H3").Select
Selection.Font.Underline = xlUnderlineStyleSingle
Selection.Font.Bold = True
Range("A3").Select
ActiveCell.FormulaR1C1 = "Project"
Range("B3").Select
ActiveCell.FormulaR1C1 = "Task"
Range("C3").Select
ActiveCell.FormulaR1C1 = "Expnd Type"
Range("D3").Select
ActiveCell.FormulaR1C1 = "Item Date"
Range("E3").Select
ActiveCell.FormulaR1C1 = "Supplier"
Range("F3").Select
ActiveCell.FormulaR1C1 = "Burden Cost"
Range("G3").Select
ActiveCell.FormulaR1C1 = "Comment"
Range("H3").Select
ActiveCell.FormulaR1C1 = "Expnd Org"
Range("I3").Select
End Sub


---
~~ Message posted from
http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Newbie help with cell reference


-----Original Message-----

Hi all,

I am literally creating my first macro in Excel 2002 and

ran into a
problem already. Course it's not as complicated as the

others I was
viewing; so even though I'm risking looking very dumb, at

least it
should be easy.

I have a client that created a macro to type a word or

words in a cell
(ex. A1), then go to the next cell (B1) and type another

word and keep
going til the last cell (H1). However she wants to be

able to do this
macro on any row (ex. A3 - H3)

I viewed the macro and it specifically references the

cells. So I
removed that reference in the visual basic window, but

then the macro
typed each word over top of each other in the same cell.

I'm so green,
that I don't even know the command to go to the next cell

and didn't
see it referenced in help. Any ideas? BTW I'm pasting the

actual macro
below in case I didn't type that well.

Thanks,
Carla

Sub TitleBar()
'
' TitleBar Macro
' Budget Title Bar
'
' Keyboard Shortcut: Ctrl+t
'
Range("A3:H3").Select
Selection.Font.Underline = xlUnderlineStyleSingle
Selection.Font.Bold = True
Range("A3").Select
ActiveCell.FormulaR1C1 = "Project"
Range("B3").Select
ActiveCell.FormulaR1C1 = "Task"
Range("C3").Select
ActiveCell.FormulaR1C1 = "Expnd Type"
Range("D3").Select
ActiveCell.FormulaR1C1 = "Item Date"
Range("E3").Select
ActiveCell.FormulaR1C1 = "Supplier"
Range("F3").Select
ActiveCell.FormulaR1C1 = "Burden Cost"
Range("G3").Select
ActiveCell.FormulaR1C1 = "Comment"
Range("H3").Select
ActiveCell.FormulaR1C1 = "Expnd Org"
Range("I3").Select
End Sub


---
~~ Message posted from http://www.ExcelForum.com/




.

hope this helps, it should start the macro at whatever
row is selected.

ActiveCell.Offset(, 0) = "Practice"
Selection.Font.Underline = True
Selection.Font.Bold = True

ActiveCell.Offset(, 1) = "Task"
ActiveCell.Offset(, 1).Font.Underline = True
ActiveCell.Offset(, 1).Font.Bold = True

ActiveCell.Offset(, 2) = "Expnd Type"
ActiveCell.Offset(, 2).Font.Underline = True
ActiveCell.Offset(, 2).Font.Bold = True

ActiveCell.Offset(, 3) = "Item Date"
ActiveCell.Offset(, 3).Font.Underline = True
ActiveCell.Offset(, 3).Font.Bold = True

ActiveCell.Offset(, 4) = "Supplier"
ActiveCell.Offset(, 4).Font.Underline = True
ActiveCell.Offset(, 4).Font.Bold = True

ActiveCell.Offset(, 5) = "Burden Cost"
ActiveCell.Offset(, 5).Font.Underline = True
ActiveCell.Offset(, 5).Font.Bold = True

ActiveCell.Offset(, 6) = "Comment"
ActiveCell.Offset(, 6).Font.Underline = True
ActiveCell.Offset(, 6).Font.Bold = True

ActiveCell.Offset(, 7) = "Expnd Org"
ActiveCell.Offset(, 7).Font.Underline = True
ActiveCell.Offset(, 7).Font.Bold = True

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Newbie help with cell reference


Thanks anonymous! I copied and pasted your macro and it worked
perfectly! YIPPEE! THANKS!!


---
~~ Message posted from http://www.ExcelForum.com/

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default Newbie help with cell reference

If that's what you wanted it could be improved a little bit.
Don't forget the periods before each item in the with.

with range(cells(activecell.row,0),cells(activecell.row ,7)).font
.Underline = True
.Bold = True
end with
with ActiveCell
..Offset(, 0) = "Practice"
..Offset(, 1) = "Task"
..Offset(, 2) = "Expnd Type"
..Offset(, 3) = "Item Date"
..Offset(, 4) = "Supplier"
..Offset(, 5) = "Burden Cost"
..Offset(, 6) = "Comment"
..Offset(, 7) = "Expnd Org"
end with

--
Don Guillett
SalesAid Software

"carlab68" wrote in message
...

Thanks anonymous! I copied and pasted your macro and it worked
perfectly! YIPPEE! THANKS!!


---
~~ Message posted from
http://www.ExcelForum.com/



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
cell formatting [newbie] Jon Excel Discussion (Misc queries) 3 March 28th 09 06:41 PM
Real Newbie newbie question Dave New Users to Excel 0 January 10th 07 07:55 PM
Help with Newbie question - Cell Reference [email protected] New Users to Excel 1 May 31st 06 02:43 AM
Newbie Cell Reference Question... UncleRemus New Users to Excel 2 October 30th 05 12:02 PM
NEWBIE: How can I do a "soft reference" in Excel/VBA? Dave[_29_] Excel Programming 1 September 8th 03 06:30 PM


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